Skip to content

Commit b76ef97

Browse files
committed
extra state for STIDP ; but commented out, no difference, issue lies somewhere else
1 parent 98b3a10 commit b76ef97

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

cpu.v

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ module cpu(
8181
localparam RETURN5 = 5'd24; // next state is always FETCH
8282
localparam WAITBASER = 5'd25; // next state is always WAITBASER1
8383
localparam WAITBASER1= 5'd26; // next state is always FETCH
84+
localparam STIDPWAIT = 5'd31; // next state is always FETCH
8485
reg [4:0] state = START;
8586

8687
wire [4:0] rom_raddr, next_state;
@@ -184,7 +185,7 @@ module cpu(
184185
c_waddr <= base1 + D;
185186
write_en <= 1;
186187
dwrite <= A;
187-
state <= FETCH;
188+
state <= FETCH; //STIDPWAIT; // FETCH
188189
if(register==3) D <= D + 1;
189190
end
190191
default : state <= FETCH;
@@ -344,6 +345,7 @@ module cpu(
344345
state <= FETCH;
345346
end
346347
end
348+
//STIDPWAIT: if(register==3) D <= D + 1;
347349
endcase
348350
end
349351

rom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def genrom(data):
9999
RETURN5 = 24; # next state is always FETCH
100100
WAITBASER = 25; # next state is always WAITBASER1
101101
WAITBASER1= 26; # next state is always FETCH
102+
STIDPWAIT = 31; # next state is always FETCH
102103

103104
data = {
104105
START :START,
@@ -127,7 +128,8 @@ def genrom(data):
127128
RETURN4 :RETURN5,
128129
RETURN5 :FETCH,
129130
WAITBASER :WAITBASER1,
130-
WAITBASER1:FETCH
131+
WAITBASER1:FETCH,
132+
STIDPWAIT :FETCH,
131133
}
132134

133135
data = [data[k] for k in sorted(data)]

rom.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module rom32x4 (
1313
.WRITE_MODE(1),
1414
.READ_MODE(1),
1515
.INIT_0(256'h0100000100540050000100450001004100400005001100110004000100140000),
16-
.INIT_1(256'h0000000000000000000000010144000101400115011401110001010501040101),
16+
.INIT_1(256'h0000000000000000000100010144000101400115011401110001010501040101),
1717
.INIT_2(256'h0000000000000000000000000000000000000000000000000000000000000000),
1818
.INIT_3(256'h0000000000000000000000000000000000000000000000000000000000000000),
1919
.INIT_4(256'h0000000000000000000000000000000000000000000000000000000000000000),

0 commit comments

Comments
 (0)