File tree 1 file changed +18
-28
lines changed
1 file changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -132,33 +132,6 @@ module dm_mem #(
132
132
typedef enum logic [1 : 0 ] { Idle, Go, Resume, CmdExecuting } state_e ;
133
133
state_e state_d, state_q;
134
134
135
- // hart state decode
136
- always_comb begin : p_state_decode
137
- go = 1'b0 ;
138
- resume = 1'b0 ;
139
- cmdbusy_o = 1'b1 ;
140
-
141
- unique case (state_q)
142
- Idle: begin
143
- cmdbusy_o = 1'b0 ;
144
- end
145
- Go: begin
146
- // we are already busy here since we scheduled the execution of a program
147
- cmdbusy_o = 1'b1 ;
148
- go = 1'b1 ;
149
- end
150
- Resume: begin
151
- cmdbusy_o = 1'b1 ;
152
- resume = 1'b1 ;
153
- end
154
- CmdExecuting: begin
155
- cmdbusy_o = 1'b1 ;
156
- go = 1'b0 ;
157
- end
158
- default : ;
159
- endcase
160
- end
161
-
162
135
// hart ctrl queue
163
136
always_comb begin : p_hart_ctrl_queue
164
137
cmderror_valid_o = 1'b0 ;
@@ -167,6 +140,9 @@ module dm_mem #(
167
140
168
141
unique case (state_q)
169
142
Idle: begin
143
+ cmdbusy_o = 1'b0 ;
144
+ go = 1'b0 ;
145
+ resume = 1'b0 ;
170
146
if (cmd_valid_i && halted_q_aligned[hartsel] && ! unsupported_command) begin
171
147
// give the go signal
172
148
state_d = Go;
@@ -184,26 +160,40 @@ module dm_mem #(
184
160
end
185
161
186
162
Go: begin
163
+ // we are already busy here since we scheduled the execution of a program
164
+ cmdbusy_o = 1'b1 ;
165
+ go = 1'b1 ;
166
+ resume = 1'b0 ;
187
167
// the thread is now executing the command, track its state
188
168
if (going) begin
189
169
state_d = CmdExecuting;
190
170
end
191
171
end
192
172
193
173
Resume: begin
174
+ cmdbusy_o = 1'b1 ;
175
+ go = 1'b0 ;
176
+ resume = 1'b1 ;
194
177
if (resuming_q_aligned[hartsel]) begin
195
178
state_d = Idle;
196
179
end
197
180
end
198
181
199
182
CmdExecuting: begin
183
+ cmdbusy_o = 1'b1 ;
184
+ go = 1'b0 ;
185
+ resume = 1'b0 ;
200
186
// wait until the hart has halted again
201
187
if (halted_aligned[hartsel]) begin
202
188
state_d = Idle;
203
189
end
204
190
end
205
191
206
- default : ;
192
+ default : begin
193
+ cmdbusy_o = 1'b1 ;
194
+ go = 1'b0 ;
195
+ resume = 1'b0 ;
196
+ end
207
197
endcase
208
198
209
199
// only signal once that cmd is unsupported so that we can clear cmderr
You can’t perform that action at this time.
0 commit comments