diff --git a/src/spi/hdl/spi.v b/src/spi/hdl/spi.v index 027d249..830e837 100644 --- a/src/spi/hdl/spi.v +++ b/src/spi/hdl/spi.v @@ -10,8 +10,8 @@ module spi (/*AUTOARG*/ spi_irq, access_out, packet_out, wait_out, m_sclk, m_mosi, m_ss, s_miso, // Inputs - nreset, clk, master_mode, access_in, packet_in, wait_in, m_miso, - s_sclk, s_mosi, s_ss + nreset, clk, hw_en, access_in, packet_in, wait_in, m_miso, s_sclk, + s_mosi, s_ss ); //################################################################## @@ -23,10 +23,10 @@ module spi (/*AUTOARG*/ parameter UREGS = 13; // number of user slave regs //clk, reset, irq - input nreset; // asynch active low reset - input clk; // core clock - input master_mode;// master mode selector - + input nreset; // asynch active low reset + input clk; // core clock + input hw_en; // block enable pin + //interrupt output output spi_irq; // interrupt output @@ -72,6 +72,7 @@ module spi (/*AUTOARG*/ /*spi_master AUTO_TEMPLATE (.clk (clk), .nreset (nreset), + .hw_en (hw_en), .\(.*\)_in (\1_in[]), .\(.*\) (m_\1[]), ); @@ -89,6 +90,7 @@ module spi (/*AUTOARG*/ // Inputs .clk (clk), // Templated .nreset (nreset), // Templated + .hw_en (hw_en), // Templated .miso (m_miso), // Templated .access_in (access_in), // Templated .packet_in (packet_in[PW-1:0]), // Templated @@ -101,6 +103,7 @@ module spi (/*AUTOARG*/ /*spi_slave AUTO_TEMPLATE (.clk (clk), .spi_irq (spi_irq), .nreset (nreset), + .hw_en (hw_en), .\(.*\)_in (\1_in[]), .\(.*\) (s_\1[]), ); @@ -119,6 +122,7 @@ module spi (/*AUTOARG*/ // Inputs .clk (clk), // Templated .nreset (nreset), // Templated + .hw_en (hw_en), // Templated .sclk (s_sclk), // Templated .mosi (s_mosi), // Templated .ss (s_ss), // Templated diff --git a/src/spi/hdl/spi_master.v b/src/spi/hdl/spi_master.v index 2212d17..953b767 100644 --- a/src/spi/hdl/spi_master.v +++ b/src/spi/hdl/spi_master.v @@ -9,7 +9,7 @@ module spi_master(/*AUTOARG*/ // Outputs sclk, mosi, ss, wait_out, access_out, packet_out, // Inputs - clk, nreset, miso, access_in, packet_in, wait_in + clk, nreset, hw_en, miso, access_in, packet_in, wait_in ); //parameters @@ -21,6 +21,7 @@ module spi_master(/*AUTOARG*/ //clk,reset, cfg input clk; // core clock input nreset; // async active low reset + input hw_en; // hardware enable pin //IO interface output sclk; // spi clock @@ -80,6 +81,7 @@ module spi_master(/*AUTOARG*/ // Inputs .clk (clk), .nreset (nreset), + .hw_en (hw_en), .rx_data (rx_data[63:0]), .rx_access (rx_access), .spi_state (spi_state[1:0]), @@ -100,7 +102,8 @@ module spi_master(/*AUTOARG*/ spi_master_fifo #(.AW(AW), .DEPTH(DEPTH)) - spi_master_fifo(/*AUTOINST*/ + spi_master_fifo( + /*AUTOINST*/ // Outputs .fifo_prog_full (fifo_prog_full), .wait_out (fifo_wait), // Templated @@ -109,6 +112,7 @@ module spi_master(/*AUTOARG*/ // Inputs .clk (clk), .nreset (nreset), + .spi_en (spi_en), .emode (emode), .access_in (access_in), .packet_in (packet_in[PW-1:0]), @@ -131,7 +135,6 @@ module spi_master(/*AUTOARG*/ // Inputs .clk (clk), .nreset (nreset), - .spi_en (spi_en), .cpol (cpol), .cpha (cpha), .lsbfirst (lsbfirst), diff --git a/src/spi/hdl/spi_master_fifo.v b/src/spi/hdl/spi_master_fifo.v index 7e4e9de..fac954e 100644 --- a/src/spi/hdl/spi_master_fifo.v +++ b/src/spi/hdl/spi_master_fifo.v @@ -3,7 +3,7 @@ module spi_master_fifo (/*AUTOARG*/ // Outputs fifo_prog_full, wait_out, fifo_empty, fifo_dout, // Inputs - clk, nreset, emode, access_in, packet_in, fifo_read + clk, nreset, spi_en, emode, access_in, packet_in, fifo_read ); //##################################################################### //# INTERFACE @@ -20,6 +20,7 @@ module spi_master_fifo (/*AUTOARG*/ //clk,reset, cfg input clk; // clk input nreset; // async active low reset + input spi_en; // spi enable input emode; // epiphany transfer mode output fifo_prog_full; // fifo full indicator for status @@ -72,7 +73,8 @@ module spi_master_fifo (/*AUTOARG*/ ((1<