CPLD bug fixes

This commit is contained in:
Jeremy Shen
2026-05-25 18:13:03 +08:00
parent 74cd2ae192
commit 2dca3709ef
10 changed files with 47 additions and 34 deletions
+6
View File
@@ -109,6 +109,9 @@ module CPLD_Con (
4'b1000: begin
PMU_RC <= 4'b0110;
end
default:begin
PMU_RC <= 4'b0000;
end
endcase
end
else if (dc_t == 1'b1) begin
@@ -125,6 +128,9 @@ module CPLD_Con (
4'b1000: begin
PMU_RC <= 4'b1000;
end
default:begin
PMU_RC <= 4'b0000;
end
endcase
end
done_flag <= 1'b1;
+3 -1
View File
@@ -131,7 +131,9 @@ module Reg_file (
// Wait for Controller to register the command and pull 'done' LOW (Busy)
EXEC_ACK: begin
busy_flag <= 1'b1;
state <= EXEC_WAIT;
if (i_con_done == 1'b0) begin
state <= EXEC_WAIT;
end
// Optional: Timeout counter here to prevent hanging if Controller is dead
end
+4 -4
View File
@@ -6,7 +6,7 @@ module RelayConTop (
input i_mosi,
input i_cs,
output o_miso,
output o_rvaild,
output o_rvalid,
input i_rready,
input i_wvaild,
@@ -23,7 +23,7 @@ module RelayConTop (
wire [23:0]w_data ;
wire [6:0]reg_addr ;
wire cmd_vaild;
wire cmd_valid;
wire reg_busy;
wire wr_flag; //1=write,0=read
wire bus_err_flag;
@@ -55,7 +55,7 @@ module RelayConTop (
.i_wvalid(i_wvalid),
.i_reg_busy(reg_busy),
.i_rdata(r_data),
.o_cmd_valid(cmd_vaild),
.o_cmd_valid(cmd_valid),
.o_wr(wr_flag),
.o_miso(o_miso),
.o_rvalid(o_rvalid),
@@ -68,7 +68,7 @@ module RelayConTop (
Reg_file CPLD_Reg_3(
.i_sys_clk(i_sys_clk),
.i_rst_n(i_rst_n),
.i_wr_req(cmd_vaild),
.i_wr_req(cmd_valid),
.i_wr(wr_flag),
.i_addr(reg_addr),
.i_wdata(w_data),