Skip to content

Commit 4b3bae0

Browse files
committed
simplified
1 parent a1a81b7 commit 4b3bae0

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

examples/thread_myverilog_ipcore/test_thread_myverilog_ipcore.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,9 @@
10861086
(_tmp_5 == 7)? _saxi_resetval_7 : 'hx;
10871087
reg _saxi_cond_0_1;
10881088
assign saxi_wready = _saxi_register_fsm == 2;
1089+
reg start;
1090+
wire busy;
1091+
reg [ADDR_WIDTH-1:0] size;
10891092
wire pe_start;
10901093
wire pe_busy;
10911094
wire [ADDR_WIDTH-1+1-1:0] pe_size;
@@ -1103,9 +1106,9 @@
11031106
(
11041107
.CLK(CLK),
11051108
.RST(RST),
1106-
.start(pe_start),
1107-
.busy(pe_busy),
1108-
.size(pe_size),
1109+
.start(start),
1110+
.busy(busy),
1111+
.size(size),
11091112
.addr(pe_addr),
11101113
.rdata(pe_rdata),
11111114
.wdata(pe_wdata),
@@ -1134,12 +1137,6 @@
11341137
end
11351138
11361139
assign pe_rdata = ram_a_1_rdata;
1137-
reg start;
1138-
wire busy;
1139-
reg [ADDR_WIDTH-1:0] size;
1140-
assign pe_start = start;
1141-
assign pe_size = size;
1142-
assign busy = pe_busy;
11431140
reg [32-1:0] th_memcpy;
11441141
localparam th_memcpy_init = 0;
11451142
reg signed [32-1:0] _th_memcpy_copy_bytes_0;

examples/thread_myverilog_ipcore/thread_myverilog_ipcore.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,28 +113,24 @@ def mkMemcpy():
113113

114114
datawidth = m.Parameter('DATA_WIDTH', datawidth)
115115
addrwidth = m.Parameter('ADDR_WIDTH', addrwidth)
116-
117-
# import verilog submodule
116+
117+
# import verilog submodule
118+
start = m.Reg('start', initval=0)
119+
busy = m.Wire('busy')
120+
size = m.Reg('size', addrwidth, initval=0)
121+
118122
sub = Submodule(m, pe_verilog_code, 'inst_pe', prefix='pe_',
119123
arg_params=(('ADDR_WIDTH', addrwidth),
120124
('DATA_WIDTH', datawidth)),
121-
arg_ports=(('CLK', clk), ('RST', rst)),
125+
arg_ports=(('CLK', clk), ('RST', rst),
126+
('start', start), ('busy', busy), ('size', size)),
122127
as_wire=('start', 'busy', 'size',
123128
'addr', 'rdata', 'wdata', 'wenable'))
124129

125130
# connect ports to RAM
126131
ram_a.connect_rtl(1, sub['addr'], sub['wdata'],
127132
sub['wenable'], sub['rdata'])
128133

129-
# control ports of submodule
130-
start = m.Reg('start', initval=0)
131-
busy = m.Wire('busy')
132-
size = m.Reg('size', addrwidth, initval=0)
133-
134-
sub['start'].assign(start)
135-
sub['size'].assign(size)
136-
busy.assign(sub['busy'])
137-
138134
def control_processing_unit(v):
139135
size.value = v
140136
start.value = 1

0 commit comments

Comments
 (0)