Code clean up and yet another RTC fix...

Added back the core CoCo3FPGA.sdc file.  Fixes hour increment on RTC.
This commit is contained in:
shodge12 committed 2022-01-11 02:24:04 -05:00
1 parent ae77edd2f2
commit 780527f759
5 files changed
+29 -120

No files matched your search

-13
View File
@@ -1,16 +1,3 @@
#create_clock -period 20.000 -name CLK50MHZ [get_ports CLK*]
#derive_pll_clocks
#derive_clock_uncertainty
#set_input_delay -fall -clock CLK50MHZ 12 [get_ports RAM0_DATA*]
#set_input_delay -fall -clock CLK50MHZ 12 [get_ports RAM1_DATA*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM0_ADDRESS*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM1_ADDRESS*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM0_BE*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM1_BE*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM0_RW*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports RAM1_RW*]
#set_output_delay -fall -clock CLK50MHZ 1 [get_ports PH_2_RAW]
create_clock -period 20.000 -name CLK50MHZ [get_ports CLK*]
derive_pll_clocks
derive_clock_uncertainty
+1
View File
@@ -26,3 +26,4 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/coco_mem_fetch.sv
set_global_assignment -name VERILOG_FILE rtl/EE_Cold_Bt.v
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_32K.vhd
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_8K.vhd
set_global_assignment -name SDC_FILE rtl/CoCo3FPGA.sdc
+9
View File
@@ -0,0 +1,9 @@
create_clock -period 1000.000 -name img_mounted[3] [get_nodes emu:emu|hps_io:hps_io|img_mounted[3]]
create_clock -period 1000.000 -name img_mounted[2] [get_nodes emu:emu|hps_io:hps_io|img_mounted[2]]
create_clock -period 1000.000 -name img_mounted[1] [get_nodes emu:emu|hps_io:hps_io|img_mounted[1]]
create_clock -period 1000.000 -name img_mounted[0] [get_nodes emu:emu|hps_io:hps_io|img_mounted[0]]
create_clock -period 1000.000 -name RESET_N [get_nodes emu:emu|coco3fpga:coco3|RESET_N]
#set_false_path -from [get_nodes sysmem_lite:sysmem|sysmem_HPS_fpga_interfaces:fpga_interfaces|clocks_resets~FF_4365]
create_clock -period 17.46 -name PH_2 [get_nodes emu:emu|coco3fpga:coco3|PH_2_RAW]
create_clock -period 1000.000 -name CLK_6551[4] [get_nodes emu:emu|coco3fpga:coco3|CLK_6551[4]]
+15 -106
View File
@@ -1036,8 +1036,8 @@ in any banks in any order, by simply writing the proper data into these latches.
assign DATA_IN =
(RAM0_BE0_L & end_hold) ? hold_data_L[7:0]:
(RAM0_BE1_L & end_hold) ? hold_data_L[15:8]:
(sdram_BE_0) ? hold_data_L[7:0]:
(sdram_BE_1) ? hold_data_L[15:8]:
// RAM0_BE0 ? RAM0_DATA_O[7:0]: Removal of sram data out [V5]
// RAM0_BE1 ? RAM0_DATA_O[15:8]:
// RAM1_BE0 ? RAM1_DATA[7:0]:
@@ -1384,26 +1384,7 @@ begin
end
// Combinatorial clocks :(
//assign UART1_CLK = (SWITCH[8:7] == 2'b11) ? COM1_CLOCK_X: // 921600
// COM1_CLOCK;
//assign WF_CLOCK = (WF_BAUD == 2'b11) ? COM1_CLOCK_X: // 921600
// COM3_CLOCK;
// Clock for RS232 PAK (6551)
// 24 MHz / 13 = 1.846 MHz
/*always @(negedge CLK24MHZ or negedge RESET_N)
begin
if(!RESET_N)
begin
COM2_STATE <= 13'b0000000000001;
end
else
begin
COM2_STATE <= {COM2_STATE[11:0],COM2_STATE[12]};
end
end
*/
// 14.814814815 MHz / 8 = 1.851851852 MHz / 16 = 115740.741 = 115200 + 0.469393%
// CLK_57
always @(negedge clk_sys or negedge RESET_N)
@@ -1442,6 +1423,8 @@ assign sdram_cpu_addr = {4'b0000, BLOCK_ADDRESS[7:0], ADDRESS[12:1], ADDRESS[0]}
assign sdram_cpu_din = DATA_OUT;
reg [24:0] sdram_cpu_addr_L;
reg last_write;
reg sdram_BE_0, sdram_BE_1;
wire cache_hit /* synthesis preserve */;
assign cache_hit = (sdram_cpu_addr[24:1] == sdram_cpu_addr_L[24:1]);
@@ -1469,10 +1452,14 @@ begin
sdram_cpu_rnw <= 1'b1;
sdram_cpu_addr_L <= 24'h000000;
last_write <= 1'b1;
sdram_BE_0 <= 1'b0;
sdram_BE_1 <= 1'b0;
end
else
begin
clear_data_ready <= 1'b0;
sdram_BE_0 <= 1'b0;
sdram_BE_1 <= 1'b0;
// If we are in hold were done @ data_ready.
if (hold)
@@ -1484,7 +1471,8 @@ begin
end_hold <= 1'b1;
clear_data_ready <= 1'b1;
hold_data_L <= hold_data;
// hold_cnt <= 1'b00;
sdram_BE_0 <= RAM0_BE0_L;
sdram_BE_1 <= RAM0_BE1_L;
end
end
@@ -1542,6 +1530,8 @@ begin
if (RW_N & cache_hit & ~last_write) // Read cache hit on stored on 16 hold_data value?
begin
end_hold <= 1'b1; // If so then end the cpu_ena cycle with the updated byte enable
sdram_BE_0 <= !ADDRESS[0];
sdram_BE_1 <= ADDRESS[0];
end
else
begin
@@ -1555,113 +1545,36 @@ begin
end
end
//***************************************
// Gart
//***************************************
// This needs a total rework
// if(ADDRESS[15:0]==16'hFF73)
// begin
// RAM0_RW_N <= RW_N;
// if(!RW_N)
// begin
// RAM0_ADDRESS <= GART_WRITE[20:1];
// end
// else
// begin
// RAM0_ADDRESS <= GART_READ[20:1];
// end
// if (!RW_N)
// begin
// RAM0_DATA_I[15:0] <= {DATA_OUT, DATA_OUT};
// end
// end
// else
// begin
// if(!VMA & (GART_CNT != 17'h00000))
// begin
// if(GART_CNT[0])
// begin
// RAM0_RW_N <= 1'b0;
// RAM0_ADDRESS <= GART_WRITE[20:1];
// RAM0_DATA_I[15:0] <= {GART_BUF, GART_BUF};
// end
// else
// begin
// RAM0_RW_N <= 1'b1;
// RAM0_ADDRESS <= GART_READ[20:1];
// end
// end
// else
// begin
// RAM0_RW_N <= RW_N;
// RAM0_ADDRESS <= {BLOCK_ADDRESS[7:0], ADDRESS[12:1]};
// if (!RW_N)
// begin
// RAM0_DATA_I[15:0] <= {DATA_OUT, DATA_OUT};
// end
// end
// end
// end
6'h01:
begin
// if(!VMA & !GART_CNT[0])
// begin
// GART_BUF <= DATA_IN;
// end
PH_2_RAW <= 1'b0;
// if we are not in a memory read [hold] then terminate cpu_ena - just like PH_2
if (!hold)
cpu_ena <= 1'b0;
// Grab sram data to supply after the read hold delay
// hold_data <= RAM0_DATA_O;
CLK <= 6'h02;
end
6'h07: // 64/8 = 7.16
begin
if(SWITCH_L == 3'b101) //Rate = 7.16?
if(SWITCH_L == 3'b101) //Rate = 7.16
CLK <= 6'h00;
else
CLK <= 6'h08;
end
6'h0F: // 64/16 = 3.58
begin
if(SWITCH_L == 3'b011) //Rate = 3.58?
if(SWITCH_L == 3'b011) //Rate = 3.58
CLK <= 6'h00;
else
CLK <= 6'h10;
end
6'h1F: // 64/32 = 1.7857
begin
if(SWITCH_L == 3'b001) //Rate = 1.78?
if(SWITCH_L == 3'b001) //Rate = 1.78?
CLK <= 6'h00;
else
CLK <= 6'h20;
end
// 6'h1B: // 50/28 = 1.7857
// 6'h17: // 50/24 = 2.0833
// begin
// RAM0_ADDRESS <= VIDEO_ADDRESS[19:0];
// RAM0_BE0_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// RAM0_BE1_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// VIDEO_BUFFER <= RAM0_DATA_O;
// if(SWITCH_L[0]) //Rate = 1?
// CLK <= 6'h00;
// else
// CLK <= 6'h20;
// end
// 6'h37: // 50/56 = 0.89286
// begin
// RAM0_ADDRESS <= VIDEO_ADDRESS[19:0];
// RAM0_BE0_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// RAM0_BE1_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// VIDEO_BUFFER <= RAM0_DATA_O;
// CLK <= 6'h00;
// end
6'h3F: // Just in case
begin
CLK <= 6'h00;
@@ -1669,10 +1582,6 @@ begin
default:
begin
CLK <= CLK + 1'b1;
// RAM0_ADDRESS <= VIDEO_ADDRESS[19:0];
// RAM0_BE0_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// RAM0_BE1_N <= !(!VIDEO_ADDRESS[21] & !VIDEO_ADDRESS[20]);
// VIDEO_BUFFER <= RAM0_DATA_O;
end
endcase
end
+4 -1
View File
@@ -65,6 +65,7 @@ assign O_SEC = (4'd10 * data[SEC][6:4]) + data[SEC][3:0];
always @(posedge clk)
begin
seccnt <= seccnt + 1;
if(seccnt >= CLOCK_RATE)
begin
@@ -96,7 +97,9 @@ begin
data[HR][3:0] <= 0;
data[HR][5:4] <= data[HR][5:4] + 1'd1;
end
else if (data[HR][6:0] == {3'd2,4'd3})
else
data[HR][3:0] <= data[HR][3:0] + 1'd1;
if (data[HR][6:0] == {3'd2,4'd3})
begin
data[HR][3:0] <= 4'd0;
data[HR][6:4] <= 3'd0;