Skip to content

jsl/si/bus

Package name: jsl/si/bus

Summary

ShortTrace

A wrapper for KeyValue indicating that the given pair of

Constructors

Function Description
ShortTrace Constructor for defstruct ShortTrace

General Definitions

Function Description
topo-bus This function will construct chained topology net consisting of

Definitions

ShortTrace

A wrapper for KeyValue indicating that the given pair of

public defstruct ShortTrace <: KeyValue

objects should be connected by a short trace.

In this toy example, port p1 will be connected to r1.p[1] with a short trace.

require p1 from mcu
inst r1 : my-resitor
port p2
topo-bus(ShortTrace(p1 => r1) => p2)
  • Note that ShortTrace will recursive apply to any internal segments. To constrain both traces, we can simply write ShortTrace(p1 => r1 => p2).

Constructors

ShortTrace

Constructor for defstruct ShortTrace

public defn ShortTrace (kv:KeyValue)

General Definitions

topo-bus

This function will construct chained topology net consisting of

public defn topo-bus (pair:KeyValue) -> Tuple<JITXObject>

  • Returns Tuple<JITXObject>

a sequence of "bus nodes".

Given a sequence of key-value pairs of nodes, this function will connect them and generate topology segments.

In this context, a node is either: * A tuple of single-pin or array ports * A single-pin or array port * An instance * An Instantiable * A "ShortTrace"

If given an Instantiable for one node of the chain, this function will create as many concrete instances as necessary.

The left- and right-most nodes of the chain must be ports from the JITX design. Both concrete and abstract require ports work. They cannot be instances or instantiables.

We assume that all concrete segments are the same size and shape: we can only compute topo-bus([a, b, c] => [d, e, f]) when port a matches port d, and so on.

When connecting instances or Instantiables, we assume that the object either has ports [p[1], p[2]] or ports [c, a]. We will connect them in that order.

Returns a tuple of all newly-instantiated objects.

port mii : rmii-bus
require sw-bus : rmii-bus from mcu
val series-R-type = create-resistor(resistance = 51.0, precision = (1 %), case = ["0603"])
val rx-bus = [sw-bus.rxd, sw-bus.crs-dv, sw-bus.ref-clk]
val rx-out = [mii.rxd, mii.crs-dv, mii.ref-clk]
topo-bus(ShortTrace(rx-bus => series-R-type) => rx-out)
  • create-resistor returns an Instantiable

  • sw-bus.rxd and mii.rxd are both PortArray instances containing two ports. topo-bus will thus return a tuple of four new resistors that connect the two buses.

  • All objects in rx-bus will be connected to their respective resistor with a short-trace.

Related Packages

Forwarded by package: jsl/si