diff options
author | Andrew Zonenberg <azonenberg@drawersteak.com> | 2016-12-20 09:58:02 +0800 |
---|---|---|
committer | Andrew Zonenberg <azonenberg@drawersteak.com> | 2016-12-20 09:58:02 +0800 |
commit | eb80ec84aaa8789d554a1246e8d07c33d2882974 (patch) | |
tree | e9472789397b227b537d9bfd7da7982782ea8973 /techlibs/greenpak4 | |
parent | fcd40fd41e9e45c8a1e0c48ca3ee6e874ce61d5b (diff) | |
download | yosys-eb80ec84aaa8789d554a1246e8d07c33d2882974.tar.gz yosys-eb80ec84aaa8789d554a1246e8d07c33d2882974.tar.bz2 yosys-eb80ec84aaa8789d554a1246e8d07c33d2882974.zip |
greenpak4: Initial implementation of GP_SPI cell
Diffstat (limited to 'techlibs/greenpak4')
-rw-r--r-- | techlibs/greenpak4/cells_sim.v | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/techlibs/greenpak4/cells_sim.v b/techlibs/greenpak4/cells_sim.v index 27c5ff054..6b8280eb2 100644 --- a/techlibs/greenpak4/cells_sim.v +++ b/techlibs/greenpak4/cells_sim.v @@ -589,6 +589,33 @@ module GP_SHREG(input nRST, input CLK, input IN, output OUTA, output OUTB); endmodule +module GP_SPI( + input SCK, + input MOSI, + input CSN, + output reg MISO, + input[7:0] DIN_HIGH, + input[7:0] DIN_LOW, + output reg[7:0] DOUT_HIGH, + output reg[7:0] DOUT_LOW); + + initial MISO = 0; + initial DOUT_HIGH = 0; + initial DOUT_LOW = 0; + + parameter ADC_BUFFER = 0; //set true to use SPI data as ADC buffer... TODO + parameter DATA_WIDTH = 8; //byte or word width + parameter SPI_CPHA = 0; //SPI clock phase + parameter SPI_CPOL = 0; //SPI clock polarity + parameter DIRECTION = "INPUT"; //SPI data direction (either input to chip or output to host) + //parallel output to fabric not yet implemented + + //TODO: write sim model + //TODO: SPI SDIO control... can we use ADC output while SPI is input?? + //TODO: clock sync + +endmodule + //keep constraint needed to prevent optimization since we have no outputs (* keep *) module GP_SYSRESET(input RST); |