Skip to content

Commit d6bfc68

Browse files
committed
use assign for memory read lines, initialise with readmem
1 parent 87ce3e3 commit d6bfc68

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

xml/XMLdecoder.v

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,17 @@ module XMLDecoder(
7777
wire _isData = outValid && !intag && !_isComment;
7878

7979
// export the stack depth positions
80-
wire [7:0] s0 = tagno[0];
81-
wire [7:0] s1 = tagno[1];
82-
wire [7:0] s2 = tagno[2];
83-
wire [7:0] s3 = tagno[3];
84-
wire [7:0] s4 = tagno[4];
85-
wire [7:0] s5 = tagno[5];
86-
wire [7:0] s6 = tagno[6];
87-
wire [7:0] s7 = tagno[7];
88-
89-
// This will be replaced in synthesis with EBR reset vector
90-
integer k;
91-
initial begin
92-
for (k = 0; k < 9; k = k + 1) begin
93-
tagno[k] <= 0;
94-
end
95-
end
96-
// END
80+
assign s0 = tagno[0];
81+
assign s1 = tagno[1];
82+
assign s2 = tagno[2];
83+
assign s3 = tagno[3];
84+
assign s4 = tagno[4];
85+
assign s5 = tagno[5];
86+
assign s6 = tagno[6];
87+
assign s7 = tagno[7];
88+
89+
// initialise to all zeros after configuration
90+
initial $readmemh("stack_zeros.txt", tagno);
9791

9892
always @(posedge CLOCK) begin
9993
if (inValid || vnn || vn || v) begin

xml/stack_zeros.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
0
2+
0
3+
0
4+
0
5+
0
6+
0
7+
0
8+
0

0 commit comments

Comments
 (0)