refdes
names for the block's I/O.
pinlabel
names for the block's pins.
block-net-rename.scm
script to instantiate any number of blocks.
led-blue-block.sch
:
The
refdes
for the input and output are labeled LED_ANODE_{n}
and LED_CATHODE_{n}
. Later, a script will substitute a block number for the "{n}" when instantiating this block schematic.
led-blue-block.sym
:
I have made the
pinlabel
values for the pins temporarily visible for the screen shot. They match the corresponding refdes
of the block schematic: LED_ANODE_{n}
and LED_CATHODE_{n}
. Again, the script will substitute a block number for the "{n}" when instantiating this block symbol.
The attribute labeled LED_BLUE_{n}
is named block-rename
to tell the script to substitute the "{n}" here as well. It is there to identify the block when the instantiated symbol is included in the schematic.
I've made the source
attribute temporarily visible, too. Again, the script will substitute the "{n}" with a block number. In my workflow (using yar) the final, renumbered schematic files end with the extension .renum
, so this source line will ultimately link an instantiated symbol to its corresponding instantiated schematic. It is important to get the source
attribute right because this is how gsch2pcb follows the hierarchy to pick up the block schematics. It is also what gschem uses to implement the "Hierarchy/Down Schematic" command.
block-net-rename.scm
script so it can instantiate as many blocks as you need in your schematic. For example, if you need three blue LEDs in your design, you could instantiate them like so:
$ ./block-net-rename.scm -n 1 -o led-blue-block_1.sch led-blue-block.sch $ ./block-net-rename.scm -n 1 -o led-blue-block_1.sym led-blue-block.sym $ ./block-net-rename.scm -n 2 -o led-blue-block_2.sch led-blue-block.sch $ ./block-net-rename.scm -n 2 -o led-blue-block_2.sym led-blue-block.sym $ ./block-net-rename.scm -n 3 -o led-blue-block_3.sch led-blue-block.sch $ ./block-net-rename.scm -n 3 -o led-blue-block_3.sym led-blue-block.symAt this point, the script will have created three new schematic files, and three new symbol files named as specified by the
-o
command line option.
For example, here is what the instantiated schematic for block 3, led-blue-block_3.sch
, looks like:
and here is what the instantiated symbol for block 3,
led-blue-block_3.sym
, looks like:
block-net-rename.scm
script on them. This will re-instantiate the blocks with the modified information.
I don't run the instantiation script manually as described above. Instead I use Make to do this automatically whenever an underlying block schematic or symbol has been modified.
Attachment | Size | Date | Comment | |
---|---|---|---|---|
gz | octw-guile-geda-scripts-1.0.tar.gz | 16.9 K | 11 Sep 2008 - 04:57 | gEDA Guile Scripts 1.0 |