OpenCores
URL https://opencores.org/ocsvn/s6soc/s6soc/trunk

Subversion Repositories s6soc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /s6soc
    from Rev 24 to Rev 25
    Reverse comparison

Rev 24 → Rev 25

/trunk/rtl/busmaster.v
47,8 → 47,10
`define DBG_SCOPE // About 204 LUTs, at 2^6 addresses
// `define COMPRESSED_SCOPE
`define INCLUDE_SECOND_TIMER
`define SECOND_TIMER_IS_WATCHDOG
// `define INCLUDE_RTC // About 90 LUTs
// `define FULL_BUSERR_CALCULATION
`define INCLUDE_CPU_RESET_LOGIC
// `define INCLUDE_RTC // About 90 LUTs
module busmaster(i_clk, i_rst,
i_rx_stb, i_rx_data, o_tx_stb, o_tx_data, i_tx_busy,
o_uart_cts,
147,7 → 149,7
// in the flash without needing to change our FPGA load and vice versa.
//
// 23'h404000
wire cpu_reset;
wire cpu_reset, tmrb_int;
`ifdef INCLUDE_CPU_RESET_LOGIC
reg btn_reset, x_button, r_button;
initial btn_reset = 1'b0;
157,7 → 159,11
begin
x_button <= i_btn[1];
r_button <= x_button;
`ifdef SECOND_TIMER_IS_WATCHDOG
btn_reset <= ((r_button)&&(zip_cpu_int))||(tmrb_int);
`else
btn_reset <= ((r_button)&&(zip_cpu_int));
`endif
end
assign cpu_reset = btn_reset;
`else
183,7 → 189,7
 
wire io_sel, flash_sel, flctl_sel, scop_sel, cfg_sel, mem_sel,
rtc_sel, none_sel, many_sel;
wire flash_ack, scop_ack, cfg_ack, mem_ack;
wire flash_ack, scop_ack, cfg_ack, mem_ack, many_ack;
wire rtc_ack, rtc_stall;
`ifdef INCLUDE_RTC
assign rtc_stall = 1'b0;
228,8 → 234,8
// 0000 xxxx configuration/control registers
// 1 xxxx xxxx xxxx xxxx xxxx Up-sampler taps
assign io_sel =((wb_cyc)&&(io_addr[5:0]==6'h1));
assign scop_sel =((wb_cyc)&&(io_addr[5:1]==5'h1));
assign flctl_sel= 1'b0; // ((wb_cyc)&&(io_addr[5:1]==5'h1));
assign scop_sel =((wb_cyc)&&(io_addr[5:1]==5'h1));
assign cfg_sel =((wb_cyc)&&(io_addr[5:2]==4'h1));
// zip_sel is not on the bus at this point
`ifdef INCLUDE_RTC
238,14 → 244,12
assign mem_sel =((wb_cyc)&&(io_addr[5:4]==2'h1));
assign flash_sel=((wb_cyc)&&(io_addr[5]));
 
assign none_sel =((wb_cyc)&&(wb_stb)&&(io_addr==6'h0));
/*
`ifdef FULL_BUSERR_CALCULATION
assign none_sel =((wb_cyc)&&(wb_stb)&&
((io_addr==6'h0)
||((~io_addr[5])&&(|wb_addr[22:14])))
||((~io_addr[5])&&(|wb_addr[22:14]))
||((io_addr[5:4]==2'b00)&&(|wb_addr[12])))
);
*/
/*
assign many_sel =((wb_cyc)&&(wb_stb)&&(
{3'h0, io_sel}
+{3'h0, flctl_sel}
254,10 → 258,7
+{3'h0, rtc_sel}
+{3'h0, mem_sel}
+{3'h0, flash_sel} > 1));
*/
assign many_sel = 1'b0;
 
wire many_ack;
assign many_ack =((wb_cyc)&&(
{3'h0, io_ack}
+{3'h0, scop_ack}
267,8 → 268,12
`endif
+{3'h0, mem_ack}
+{3'h0, flash_ack} > 1));
 
wire flash_interrupt, scop_interrupt, tmra_int, tmrb_int,
`else
assign many_ack = 1'b0;
assign many_sel = 1'b0;
assign none_sel =((wb_cyc)&&(wb_stb)&&(io_addr==6'h0));
`endif
wire flash_interrupt, scop_interrupt, tmra_int,
rtc_interrupt, gpio_int, pwm_int, keypad_int,button_int;
 
 
277,9 → 282,15
//
reg rx_rdy;
wire [10:0] int_vector;
assign int_vector = { gpio_int, pwm_int, keypad_int,
assign int_vector = {
gpio_int, pwm_int, keypad_int,
(~o_tx_stb), rx_rdy,
tmrb_int, tmra_int,
`ifdef SECOND_TIMER_IS_WATCHDOG
1'b0,
`else
tmrb_int,
`endif
tmra_int,
rtc_interrupt, scop_interrupt,
wb_err, button_int };
 
295,7 → 306,7
 
wire [31:0] timer_a, timer_b;
wire zta_ack, zta_stall, ztb_ack, ztb_stall;
ziptimer #(32,31)
ziptimer #(32,31,1)
zipt_a(i_clk, 1'b0, 1'b1, wb_cyc,
`ifdef INCLUDE_SECOND_TIMER
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h2),
305,12 → 316,20
wb_we, wb_data, zta_ack, zta_stall, timer_a,
tmra_int);
`ifdef INCLUDE_SECOND_TIMER
ziptimer #(32,31)
`ifdef SECOND_TIMER_IS_WATCHDOG
ziptimer #(32,31,0)
zipt_b(i_clk, cpu_reset, 1'b1, wb_cyc,
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h3),
wb_we, wb_data, ztb_ack, ztb_stall, timer_b,
tmrb_int);
`else
ziptimer #(32,31,1)
zipt_b(i_clk, cpu_reset, 1'b1, wb_cyc,
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h3),
wb_we, wb_data, ztb_ack, ztb_stall, timer_b,
tmrb_int);
`endif
`else
// assign timer_b = 32'h000;
assign timer_b = timer_a;
assign tmrb_int = 1'b0;
/trunk/rtl/altbusmaster.v
44,7 → 44,11
`endif
`define FLASH_ACCESS
`define DBG_SCOPE // About 204 LUTs, at 2^6 addresses
// `define COMPRESSED_SCOPE
`define INCLUDE_SECOND_TIMER
`define SECOND_TIMER_IS_WATCHDOG
`define INCLUDE_RTC // About 90 LUTs
`define FULL_BUSERR_CALCULATION
`define WBUBUS
module altbusmaster(i_clk, i_rst,
// DEPP I/O Control
167,7 → 171,7
 
wire io_sel, flash_sel, flctl_sel, scop_sel, cfg_sel, mem_sel,
rtc_sel, none_sel, many_sel;
wire flash_ack, scop_ack, cfg_ack, mem_ack;
wire flash_ack, scop_ack, cfg_ack, mem_ack, many_ack;
wire rtc_ack, rtc_stall;
`ifdef INCLUDE_RTC
assign rtc_stall = 1'b0;
222,7 → 226,12
assign mem_sel =((wb_cyc)&&(io_addr[5:4]==2'h1));
assign flash_sel=((wb_cyc)&&(io_addr[5]));
 
assign none_sel =((wb_cyc)&&(wb_stb)&&(io_addr==6'h0));
`ifdef FULL_BUSERR_CALCULATION
assign none_sel =((wb_cyc)&&(wb_stb)&&
((io_addr==6'h0)
||((~io_addr[5])&&(|wb_addr[22:14]))
||((io_addr[5:4]==2'b00)&&(|wb_addr[12])))
);
assign many_sel =((wb_cyc)&&(wb_stb)&&(
{3'h0, io_sel}
+{3'h0, flctl_sel}
231,9 → 240,7
+{3'h0, rtc_sel}
+{3'h0, mem_sel}
+{3'h0, flash_sel} > 1));
// assign many_sel = 1'b0;
 
wire many_ack;
assign many_ack =((wb_cyc)&&(
{3'h0, io_ack}
+{3'h0, scop_ack}
243,7 → 250,11
`endif
+{3'h0, mem_ack}
+{3'h0, flash_ack} > 1));
 
`else
assign many_ack = 1'b0;
assign many_sel = 1'b0;
assign none_sel =((wb_cyc)&&(wb_stb)&&(io_addr==6'h0));
`endif
wire flash_interrupt, scop_interrupt, tmra_int, tmrb_int,
rtc_interrupt, gpio_int, pwm_int, keypad_int,button_int;
 
253,7 → 264,8
//
reg rx_rdy;
wire [11:0] int_vector;
assign int_vector = { flash_interrupt, gpio_int, pwm_int, keypad_int,
assign int_vector = {
flash_interrupt, gpio_int, pwm_int, keypad_int,
(~o_tx_stb), rx_rdy,
tmrb_int, tmra_int,
rtc_interrupt, scop_interrupt,
271,16 → 283,34
 
wire [31:0] timer_a, timer_b;
wire zta_ack, zta_stall, ztb_ack, ztb_stall;
ziptimer #(32,31)
ziptimer #(32,31,1)
zipt_a(i_clk, 1'b0, 1'b1, wb_cyc,
`ifdef INCLUDE_SECOND_TIMER
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h2),
`else
(wb_stb)&&(io_sel)&&(wb_addr[3:1]==3'h1),
`endif
wb_we, wb_data, zta_ack, zta_stall, timer_a,
tmra_int);
ziptimer #(32,31)
`ifdef INCLUDE_SECOND_TIMER
`ifdef SECOND_TIMER_IS_WATCHDOG
ziptimer #(32,31,0)
zipt_b(i_clk, 1'b0, 1'b1, wb_cyc,
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h3),
wb_we, wb_data, ztb_ack, ztb_stall, timer_b,
tmrb_int);
`else
ziptimer #(32,31,1)
zipt_b(i_clk, 1'b0, 1'b1, wb_cyc,
(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h3),
wb_we, wb_data, ztb_ack, ztb_stall, timer_b,
tmrb_int);
`endif
`else
// assign timer_b = 32'h000;
assign timer_b = timer_a;
assign tmrb_int = 1'b0;
`endif
 
wire [31:0] rtc_data;
`ifdef INCLUDE_RTC
334,9 → 364,11
//
// Special Purpose I/O: Keypad, button, LED status and control
//
wire [3:0] w_led;
spio thespio(i_clk, wb_cyc,(wb_stb)&&(io_sel)&&(wb_addr[3:0]==4'h5),wb_we,
wb_data, spio_data, o_kp_col, i_kp_row, i_btn, o_led,
wb_data, spio_data, o_kp_col, i_kp_row, i_btn, w_led,
keypad_int, button_int);
assign o_led = { w_led[3]|w_interrupt,w_led[2]|zip_cpu_int,w_led[1:0] };
 
//
// General purpose (sort of) I/O: (Bottom two bits robbed in each
450,7 → 482,14
`ifdef DBG_SCOPE
wire scop_cfg_trigger;
assign scop_cfg_trigger = (wb_cyc)&&(wb_stb)&&(cfg_sel);
wbscope #(5'ha) wbcfgscope(i_clk, 1'b1, scop_cfg_trigger, cfg_scope,
wire scop_trigger = scop_cfg_trigger;
`ifdef COMPRESSED_SCOPE
wbscopc #(5'ha)
`else
wbscope #(5'ha)
`endif
wbcfgscope(i_clk, 1'b1, scop_trigger,
cfg_scope,
// Wishbone interface
i_clk, wb_cyc, (wb_stb)&&(scop_sel),
wb_we, wb_addr[0], wb_data,

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.