Structure Rules

Rapid HDL enforces many rules to ensure that the hardware will be well behaved. For example:
  1. A net must have a source node and at least one sink node.
  2. A net may not have more than one source node unless the network is a tri-state network.
  3. A net may not share a source node and a sink node on the same component.
  4. At least one register must be placed between a sink node and any source node that could destabilize the sink node.

Example structure error

To demonstrate a structure error, the following line will be removed from the example counter project.

In the TopLevelHardware.cs GenerateStructure() method, the reset connection will be commented out.

            //oUpCounter.ResetIn.Connection = TopLevelComponent.MainReset;

Running the program results in the following assertion error...

"Sink Node externalinterface.MAINRESET_I0 is floating, with no source or sink."

The "Retry" button will take you to the debugger.

Here, we know exactly what is wrong. However, these connection errors can be hard to track down.

One clue may be found in the Visual Studio Output Window. Before the assert caused execution to stop, the following function was called:


The resulting output is:

---------- NET -------------- <=
Source Nodes
Sink Nodes
Pass Nodes
external_interface.signal_interface.RESET_I 0
external_interface.MAIN_RESET_I 0
external_interface.TopLevel.main_reset 0
---------- END --------------

Now, we expect Reset to have a SinkNode, but none shows in this list. This is our clue that the MainReset signal was not connected to anything.

Most of the hardware structure errors will call similar helper functions to try to help visualize what nodes are present in the net and where the error is taking place.

Sometimes it may help to draw a sketch of the hardware.

This problem could be mitigated by a module that displays a schematic of the generated hardware with the faulty connections highlighted. But who has time to write something like that?

Last edited Sep 11, 2009 at 3:52 AM by allen248, version 2


No comments yet.