Skip to content

Commit

Permalink
Fix DRAM view issue
Browse files Browse the repository at this point in the history
  • Loading branch information
radiolok committed Oct 2, 2024
1 parent ff2ffa7 commit 8b1cb65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 5 additions & 4 deletions vhdl/DekatronPC/DekatronPC.sv
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ wire [AP_RAM_BIN_BW-1:0] ApAddressBin;
reg [AP_RAM_BIN_BW-1:0] ApAddressBin_Setup;
wire [AP_RAM_BIN_BW-1:0] ApAddressBin_Cnt;


reg ApRamRdy;

assign ApAddressBin = (ApRamRdy) ? ApAddressBin_Cnt : ApAddressBin_Setup;
Expand Down Expand Up @@ -120,10 +121,10 @@ always @(posedge Clk, negedge Rst_n) begin
ApAddressBin_Setup <= AP_RAM_ROWS_NUM - 1;
end else begin
if (~ApRamRdy) begin
if (ApAddressBin_Setup != 0) begin
ApAddressBin_Setup <= ApAddressBin_Setup - 1;
end else begin
if (ApAddressBin_Setup == 0) begin
ApRamRdy <= 1;
end else begin
ApAddressBin_Setup <= ApAddressBin_Setup - 1;
end
end
end
Expand All @@ -143,7 +144,7 @@ RAM #(
.Address1(ApAddress1Bin),
.Out1(ApData1),
`endif
.WE(ApRamWE),
.WE(ApRamWE | ~ApRamRdy),
.CS(ApRamCS)
);

Expand Down
11 changes: 8 additions & 3 deletions vhdl/Emulator/MS6205.sv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ module MS6205(
input wire ready,
input wire [39:0] keysCurrentState,
/* verilator lint_on UNUSEDSIGNAL */
output wire marker,
output wire marker,

input wire tx_switch_view_i, //if 1 enable automatic switch on MS6205

input wire [2:0] DPC_State
);

Expand Down Expand Up @@ -100,7 +103,9 @@ always @(negedge Clock_1us, negedge Rst_n) begin
if (tx_vld) begin
stdioRam[stdioAddr] <= tx_data;
stdioAddr <= stdioAddr + 1;
tx_view_req <= 1'b1;
if (tx_switch_view_i) begin
tx_view_req <= 1'b1;
end
end
if (ms6205_currentView == MS6205_CIO) begin
tx_view_req <= 1'b0;
Expand Down Expand Up @@ -177,7 +182,7 @@ always_ff @(negedge Clock_1ms, negedge Rst_n) begin
stdioData <= {4'b0, apAddress1[7:4]} + 8'h30;
end
(4): begin
stdioData <= {4'b0, ms6205Pos[7:4]} + 8'h30;
stdioData <= {3'b0, ms6205Pos[7:4], 1'b0} + 8'h30;
end
(5): begin
stdioData <= ":";
Expand Down
1 change: 1 addition & 0 deletions vhdl/Emulator/io_key_display_block.sv
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ MS6205 ms6205(
.marker(ms6205_marker_en),
.ready(ms6205_ready),
.DPC_State(DPC_currentState),
.tx_switch_view_i(1'b0),
.keysCurrentState(keyboard_keysCurrentState)
);

Expand Down

0 comments on commit 8b1cb65

Please sign in to comment.