diff options
author | Matt Ettus <matt@ettus.com> | 2010-02-16 22:49:02 -0800 |
---|---|---|
committer | Matt Ettus <matt@ettus.com> | 2010-02-16 22:49:02 -0800 |
commit | d4649caee02a1c76802dc4f8d7d76bb31b14ce09 (patch) | |
tree | d64c7c7b0496690ac01f865de9b4a7db32c3b7eb /usrp2/models | |
parent | b115e4d7661d64c6d20f0421908622b56a91e950 (diff) | |
download | uhd-d4649caee02a1c76802dc4f8d7d76bb31b14ce09.tar.gz uhd-d4649caee02a1c76802dc4f8d7d76bb31b14ce09.tar.bz2 uhd-d4649caee02a1c76802dc4f8d7d76bb31b14ce09.zip |
wishbone bridge now with minimal functionality. Need to check
timing and handle wait states.
Diffstat (limited to 'usrp2/models')
-rw-r--r-- | usrp2/models/gpmc_model.v | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/usrp2/models/gpmc_model.v b/usrp2/models/gpmc_model.v new file mode 100644 index 000000000..ce3acaacf --- /dev/null +++ b/usrp2/models/gpmc_model.v @@ -0,0 +1,70 @@ + + +module gpmc_model + (output EM_CLK, inout [15:0] EM_D, output reg [10:1] EM_A, output reg [1:0] EM_NBE, + output reg EM_WAIT0, output reg EM_NCS4, output reg EM_NCS6, + output reg EM_NWE, output reg EM_NOE ); + + assign EM_CLK = 0; + reg [15:0] EM_D_int; + assign EM_D = EM_D_int; + + initial + begin + EM_A <= 10'bz; + EM_NBE <= 2'b11; + EM_NWE <= 1; + EM_NOE <= 1; + EM_NCS4 <= 1; + EM_NCS6 <= 1; + EM_D_int <= 16'bz; + EM_WAIT0 <= 0; // FIXME this is actually an input + end + + task GPMC_Write; + input [10:0] addr; + input [15:0] data; + begin + #2; + EM_A <= addr[10:1]; + EM_D_int <= data; + #4; + EM_NCS6 <= 0; + #5; + EM_NWE <= 0; + #41; + EM_NWE <= 1; + EM_NCS6 <= 1; + EM_A <= 10'bz; + EM_D_int <= 16'bz; + end + endtask // GPMC_Write + + task GPMC_Read; + input [10:0] addr; + begin + #2; + EM_A <= addr[10:1]; + #4; + EM_NCS6 <= 0; + #5; + EM_NOE <= 0; + #41; + EM_NOE <= 1; + EM_NCS6 <= 1; + EM_A <= 10'bz; + $display("Data Read from GPMC: %X",EM_D); + end + endtask // GPMC_Read + + initial + begin + #1000; + GPMC_Write(36,16'hBEEF); + #1000; + GPMC_Read(36); + #1000; + $finish; + end + +endmodule // gpmc_model |