[][src]Module tydi::physical

Physical streams.

This modules defines the components of physical streams as described in the Tydi specification.

This modules defines the following types:

Examples

Minimal example

use tydi::physical::{PhysicalStream, SignalList};

// Construct a new physical stream with two elements, named "a" and "b".
// The stream has two elements lanes, no dimensionality data, a complexity
// of (major) level 2, and no user fields.
let physical_stream =
    PhysicalStream::try_new(vec![("a", 4), ("b", 8)], 2, 0, 2, vec![])?;

// Get the signal list for the physical stream.
let signal_list = physical_stream.signal_list();

// Validate the signal list bit count. It should equal to (4 + 8) * 2.
assert_eq!(signal_list.bit_count(), 24);

// For a complexity level of 8 there should be 4 additional signals.
// (2 `strb`, 1 `stai`, 1 `endi`).
let signal_list =
    SignalList::from(
        PhysicalStream::try_new(vec![("a", 4), ("b", 8)], 2, 0, 8, vec![])?
    );
assert_eq!(signal_list.bit_count(), 28);

Structs

Complexity

Interface complexity level.

Fields
PhysicalStream

Physical stream.

Signal
SignalList

Signal list for the signals in a physical stream.

Enums

Origin
Width

Type Definitions

BitCount

Positive number of bits.