8 Signals

Understanding Signals
Signals are a core concept in impulse, representing data streams with various attributes and behaviors. This document provides a comprehensive overview of signals, their types, tags, scale, and format specifiers. Whether you’re working with discrete or continuous signals, this guide will help you understand their structure and usage in impulse.
Overview of Signals
A signal can contain up to 2^31 samples and includes:
- Name: Signal name.
- Description: Comments about the signal.
- Process Type: Discrete or continuous signals.
- Signal Type: One of the predefined signal types.
- Tags: Provide additional context for the signal.
- Scale: Represents the dimension of a signal (e.g., bit vector or array size).
- Format Specifier: Defines the textual representation of signal values.
- Domain Base: Minimum distance between two samples (e.g., ns or ps).
- Start: The starting point of the signal.
- End: The ending point of the signal.
- Rate: The rate at which the signal progresses.
- Samples: Up to 2^31 value changes.
- Attachments: Relations and labels for each sample.
Signal Characteristics
Process Type
Signals can be:
- Discrete: Samples can occur at any domain base position, with the restriction:
position(sample(idx)) <= position(sample(idx+1))
. The process type is discrete when the rate is set to zero. - Continuous: Defined by start, end, and rate indicators, ensuring definite sample positions. Discrete signals only have start and end indicators, with each sample containing the delta position to its predecessor.
The position of a signal is represented as a 64-bit signed integer value, which is a multiple of the domain base.
Signal Type
Supported signal types:
- Logic: 1..N bits stored as 2-state, 4-state, or 16-state data.
- Float: 32-bit or 64-bit, including arrays.
- Integer: Any length, including arrays.
- Event: Enumeration, including arrays.
- Text: Any length, including arrays.
- Structure: Unlimited members (Text/Binary/Integer/Float/Enumeration).
- Binary: Can include images, etc.
Struct signals are used for logs, transactions, charts, Gantt events, and more. A struct sample combines key-value pairs with types like string, integer, float, or enum.
Signal Metadata
Tags
Tags provide additional context for signals, describing their meaning or purpose. Examples include:
default
state
event
transaction
log
chart
image
Tags can be used for presentation purposes, such as generating Gantt plots or creating templates for specific signal types.
Scale
The scale of a signal defines its dimension, such as the size of a bit vector or an array. Examples include:
bits=16
(for a 16-bit logic signal)dim=2
(for a 2-dimensional array)
Format Specifier
The format specifier defines the textual representation of signal values in plots and tables. Examples include:
default
: Use default value.none
: No textual representation.binary
: Binary representation.octal
: Octal representation.hex
: Hexadecimal representation.ascii
: ASCII representation.decimal
: Decimal representation.label
: Textual representation.boolean
: Boolean representation.
For arrays and structs, the format specifier also defines how multiple values are represented:
values
: Show values only.keyValues
: Show key-value pairs.
Signal Data
Samples
Each sample can be a none or non-none value of a signal type, optionally tagged.
The sample tag can vary:
- It can be tagged or non-tagged.
- It can also be an enumeration, which can be used to describe a sample as “narrower,” “warning,” or “information.”
Note: The sample tag is different from the tag of a signal. While the signal tag provides metadata about the signal itself (e.g., state
, event
), the sample tag describes individual samples within the signal and their specific characteristics.
Associations and Labels
- Association: Adds a curve with textual information from a sample to another signal at a relative position.
- Label: Adds text and symbols relative to a sample.
Additional Features
Signal Proxies
Proxies share signal data between different logical or physical signals, providing a new name or location within the record hierarchy.
Advanced Signal Structures
Members (Arrays and Struct Signal Type)
Struct signals consist of members, each with:
- Name: Member name.
- Description: Comments or details about the member.
- Member Type: Data type of the member, containing the same types as in signal (e.g., Text, Binary, Integer, Float, Enumeration).
- Tags: Provide additional context for the member.
- Scale: Represents the dimension of the member (e.g., bit vector or array size).
- Format Specifier: Textual representation.
Arrays may also have members, which are optional and informative but lack type information.
Grouped Samples
Samples can be grouped. This is, for instance, a solution if you want to represent transactions. A group can consist of a starting sample, one or more intermediate samples, and an ending sample. All events in a group share the same group ID and an order descriptor (e.g., first, intermediate, last).
Example: In a SystemC TLM (Transaction-Level Modeling) simulation, a grouped sample could represent a transaction with the following stages:
- Start: Transaction begins with a
BEGIN_REQ
phase. - Intermediate: Transaction progresses with a
END_REQ
andBEGIN_RESP
phase. - End: Transaction completes with a
END_RESP
phase.
Examples of Signal Types
Logic Signal Example
- Name: LogicSignal
- Type: Logic
- Tags: state, default
- Scale: 8 bits
- Format Specifier: binary
- Process Type: Discrete
- Domain Base: ns
- Start: 0
- End: 100
- Samples: 00000001 at position 0, 00000010 at position 10
- Use Case: Representing binary states in a digital circuit.
Float Signal Example
- Name: FloatSignal
- Type: Float
- Tags: chart
- Scale: 1-dimensional
- Format Specifier: decimal
- Process Type: Continuous
- Domain Base: ms
- Start: 0
- End: 1000
- Rate: 10
- Samples: 1.23 at position 0, 2.34 at position 10
- Use Case: Representing sensor data, such as temperature readings over time.
Struct Signal Example
- Name: TransactionLog
- Type: Structure
- Tags: transaction, log
- Members:
- ID: Integer, 32 bits
- Status: Text
- Timestamp: Float, decimal format
- Samples:
- At position 0: ID=1, Status=Start, Timestamp=0.0
- At position 50: ID=1, Status=End, Timestamp=50.0
- Use Case: Logging transactions in a system with detailed metadata.
Best Practices
To effectively define and manage signals in impulse, consider the following best practices:
- Use Descriptive Names: Choose clear and descriptive names for signals and their members to improve readability.
- Apply Consistent Tags: Use tags consistently to categorize signals and samples for easier filtering and visualization.
- Choose Appropriate Scales: Define scales that accurately represent the signal’s dimension (e.g., bit width or array size).
- Leverage Format Specifiers: Use format specifiers to ensure values are displayed in a meaningful way (e.g., binary for logic signals, decimal for floats).
- Group Samples When Necessary: Use grouped samples to represent complex events, such as transactions or multi-stage processes.
- Document Metadata: Include comments or documentation for signals and their metadata to aid future users or developers.
Glossary
- Domain Base: The minimum distance between two samples, typically measured in units like nanoseconds (ns) or milliseconds (ms).
- Process Type: Indicates whether a signal is discrete or continuous.
- Format Specifier: Defines how signal values are represented textually (e.g., binary, decimal, hexadecimal).
- Tags: Metadata that provides additional context for signals or samples.
- Scale: Represents the dimension of a signal, such as bit width or array size.
- Grouped Samples: A collection of samples that represent a single logical event or process.
Conclusion
Signals are a fundamental concept in impulse, providing a flexible and powerful way to represent and analyze data streams. By understanding their characteristics, metadata, and advanced structures, you can effectively utilize signals to model and visualize complex systems. Whether you’re working with discrete or continuous data, impulse’s signal framework offers the tools you need to succeed.