Template section clone method

This commit is contained in:
Bugra Onal 2022-03-09 08:58:29 -08:00
parent b1585355e1
commit 804e5a58c5
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,8 @@ class verilog:
self.template.setTextDict('GND', self.gnd_name)
for port in self.all_ports:
self.template.cloneSection("PORTS", "PORTS" + str(port))
if port in self.readwrite_ports:
self.vf.write("// Port {0}: RW\n".format(port))
elif port in self.read_ports:

View File

@ -6,6 +6,7 @@
#>WRITE_SIZE_CMT
module #$MODULE_NAME$# (
#<PORTS
`ifdef USE_POWER_PINS
#$VDD$#,
#$GND$#,
@ -28,6 +29,7 @@ module #$MODULE_NAME$# (
// Port #$PORT_NUM$#: W
clk#$PORT_NUM#$,csb#$PORT_NUM$#,web$#PORT_NUM$#,addr#PORT_NUM$#,din#PORT_NUM$#
#>W_PORT
#>PORTS
);
#<WMASK_PAR
parameter NUM_WMASK = #$NUM_WMASK#$ ;