aboutsummaryrefslogtreecommitdiffstats
path: root/usrp2/top/N2x0/u2plus_core.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-03-05 19:14:15 -0800
committerJosh Blum <josh@joshknows.com>2012-03-16 11:29:18 -0700
commit46c612ea97d41745f6477ddb4cb024e06be8ed8c (patch)
tree11c79627b8880f4ee9c23d696aab29b1de0a4689 /usrp2/top/N2x0/u2plus_core.v
parent06654cac4a27c7852ca36394f92a5cff1028a0ea (diff)
downloaduhd-46c612ea97d41745f6477ddb4cb024e06be8ed8c.tar.gz
uhd-46c612ea97d41745f6477ddb4cb024e06be8ed8c.tar.bz2
uhd-46c612ea97d41745f6477ddb4cb024e06be8ed8c.zip
spi: created simple spi core (sr based)
Diffstat (limited to 'usrp2/top/N2x0/u2plus_core.v')
-rw-r--r--usrp2/top/N2x0/u2plus_core.v26
1 files changed, 20 insertions, 6 deletions
diff --git a/usrp2/top/N2x0/u2plus_core.v b/usrp2/top/N2x0/u2plus_core.v
index 27a5af833..3e376434a 100644
--- a/usrp2/top/N2x0/u2plus_core.v
+++ b/usrp2/top/N2x0/u2plus_core.v
@@ -149,10 +149,10 @@ module u2plus_core
);
localparam SR_MISC = 0; // 7 regs
- localparam SR_SIMTIMER = 8; // 2
+ localparam SR_USER_REGS = 8; // 2
localparam SR_TIME64 = 10; // 6
localparam SR_BUF_POOL = 16; // 4
- localparam SR_USER_REGS = 20; // 2
+ localparam SR_SPI_CORE = 20; // 3
localparam SR_RX_FRONT = 24; // 5
localparam SR_RX_CTRL0 = 32; // 9
localparam SR_RX_DSP0 = 48; // 7
@@ -278,9 +278,11 @@ module u2plus_core
.sf_dat_o(sf_dat_o),.sf_adr_o(sf_adr),.sf_sel_o(sf_sel),.sf_we_o(sf_we),.sf_cyc_o(sf_cyc),.sf_stb_o(sf_stb),
.sf_dat_i(sf_dat_i),.sf_ack_i(sf_ack),.sf_err_i(0),.sf_rty_i(0));
- // Unused Slaves 9, b, c
+ assign s2_ack = 0;
assign s4_ack = 0;
- assign s9_ack = 0; assign sb_ack = 0; assign sc_ack = 0;
+ assign s9_ack = 0;
+ assign sb_ack = 0;
+ assign sc_ack = 0;
// ////////////////////////////////////////////////////////////////////////////////////////
// Reset Controller
@@ -408,12 +410,24 @@ module u2plus_core
// /////////////////////////////////////////////////////////////////////////
// SPI -- Slave #2
+ wire [31:0] spi_debug;
+ wire [31:0] spi_readback;
+ wire spi_done;
+ simple_spi_core #(.BASE(SR_SPI_CORE), .WIDTH(9)) shared_spi(
+ .clock(dsp_clk), .reset(dsp_rst),
+ .set_stb(set_stb_dsp), .set_addr(set_addr_dsp), .set_data(set_data_dsp),
+ .readback(spi_readback), .done(spi_done),
+ .sen({sen_adc, sen_tx_db,sen_tx_adc,sen_tx_dac,sen_rx_db,sen_rx_adc,sen_rx_dac,sen_dac,sen_clk}),
+ .sclk(sclk), .mosi(mosi), .miso(miso), .debug(spi_debug)
+ );
+/*
spi_top shared_spi
(.wb_clk_i(wb_clk),.wb_rst_i(wb_rst),.wb_adr_i(s2_adr[4:0]),.wb_dat_i(s2_dat_o),
.wb_dat_o(s2_dat_i),.wb_sel_i(s2_sel),.wb_we_i(s2_we),.wb_stb_i(s2_stb),
.wb_cyc_i(s2_cyc),.wb_ack_o(s2_ack),.wb_err_o(),.wb_int_o(spi_int),
.ss_pad_o({sen_adc, sen_tx_db,sen_tx_adc,sen_tx_dac,sen_rx_db,sen_rx_adc,sen_rx_dac,sen_dac,sen_clk}),
.sclk_pad_o(sclk),.mosi_pad_o(mosi),.miso_pad_i(miso) );
+*/
// /////////////////////////////////////////////////////////////////////////
// I2C -- Slave #3
@@ -448,7 +462,7 @@ module u2plus_core
(.wb_clk_i(wb_clk), .wb_rst_i(wb_rst), .wb_stb_i(s5_stb),
.wb_adr_i(s5_adr), .wb_dat_o(s5_dat_i), .wb_ack_o(s5_ack),
- .word00(32'b0),.word01(32'b0),.word02(32'b0),.word03(32'b0),
+ .word00(spi_readback),.word01(32'b0),.word02(32'b0),.word03(32'b0),
.word04(32'b0),.word05(32'b0),.word06(32'b0),.word07(32'b0),
.word08(status),.word09(gpio_readback),.word10(vita_time[63:32]),
.word11(vita_time[31:0]),.word12(compat_num),.word13({18'b0, button, 1'b0, clk_status, serdes_link_up, 10'b0}),
@@ -514,7 +528,7 @@ module u2plus_core
.in_data(srb_rd_data), .in_valid(srb_rd_valid), .in_ready(srb_rd_ready),
.out_data(srb_wr_data), .out_valid(srb_wr_valid), .out_ready(srb_wr_ready),
.strobe(set_stb_dsp1), .addr(set_addr_dsp1), .data(set_data_dsp1),
- .word00(32'b0),.word01(32'b0),.word02(32'b0),.word03(32'b0),
+ .word00(spi_readback),.word01(32'b0),.word02(32'b0),.word03(32'b0),
.word04(32'b0),.word05(32'b0),.word06(32'b0),.word07(32'b0),
.word08(status),.word09(gpio_readback),.word10(vita_time[63:32]),
.word11(vita_time[31:0]),.word12(compat_num),.word13({18'b0, button, 1'b0, clk_status, serdes_link_up, 10'b0}),