[Ktechlab-devel] Bus support in the simulator

Zoltan Padrah zoltan.padrah at gmail.com
Sun Nov 14 15:47:17 UTC 2010


  Hi,

 I was lately thinking about how to properly support buses in
ktechlab. First I'd like to make a short review of the existing
infrastructure:

Elements are ideal models;
they have Pins;
Wires connect two Pins;
Components consist of one or more elements and pins.

Essentially a bus should be made of several Wires running in parallel,
with Pins on their end. In order to allow connecting buses to
Components, the Component "pins" should be compatible with buses and
wires. Due to this, in my opinion, we need 2 additional classes:

ComponentPin or Node (we should select proper names): such pin can be
associated with one or more Pins. In the old code, these are the
Nodes, I think.

Connector or ComponentWire: this class should connect two
ComponentPins and it should be associated with one or  more wires.

ASCII art diagram (if it looks too bad, copy it in a text editor with
fixed-width font):

ComponentPin -----(connected by) Connector ---- ComponentPin
 |                      |                          |
 | has                  | has                      | has
 |                      |                          |
 N * Pins ------ (connected by) N* Wires --------  N * Pins

This way the connector can be a bus (N > 1) or a simple wire (N=1).

 Opnions, comments?

   Zoltan




More information about the Ktechlab-devel mailing list