aboutsummaryrefslogtreecommitdiffstats
path: root/usrp2/models
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-11-10 11:29:25 -0800
committerMatt Ettus <matt@ettus.com>2010-11-10 11:29:25 -0800
commitc7be879f6156c219de331df232d1b55ae539f5dd (patch)
treebb2e8012cf7aa54cfc23b4a99e067fd72a5b80e5 /usrp2/models
parent98a4130707cf7cad9597b65504211343138391ad (diff)
parent9cd8652b42b5afcba67ef0475e5681b951fe0bdc (diff)
downloaduhd-c7be879f6156c219de331df232d1b55ae539f5dd.tar.gz
uhd-c7be879f6156c219de331df232d1b55ae539f5dd.tar.bz2
uhd-c7be879f6156c219de331df232d1b55ae539f5dd.zip
Merge branch 'u1e' into merge_u1e
* u1e: (130 commits) invert led signals because they are active low duh allow for CS to rise before, at the same time, or after OE better debug pins watch the ethernet chip select on our debug bus fix timing issue on DAC outputs with rev 2. This puts the whole system on a 90 degree phase shift send all gpmc signals to mictor updated pins to match rev2, removed dip switch, etc. seems to compile ok. pins are different on rev2 fixed makefile to compile with our new system add register to tell host about compatibility level and which image we are using move declaration to make loopback compile no need for protocol headers since we're not doing ethernet match the signal names in this design debug pins cleanup properly integrate the new tx chain catch up with tx_policy attach run_tx and run_rx to leds connect atr delay the q channel to make the channels line up on the AD9862 ... Conflicts: usrp2/control_lib/Makefile.srcs
Diffstat (limited to 'usrp2/models')
-rw-r--r--usrp2/models/gpmc_model_async.v130
-rw-r--r--usrp2/models/gpmc_model_sync.v97
2 files changed, 227 insertions, 0 deletions
diff --git a/usrp2/models/gpmc_model_async.v b/usrp2/models/gpmc_model_async.v
new file mode 100644
index 000000000..beeaee028
--- /dev/null
+++ b/usrp2/models/gpmc_model_async.v
@@ -0,0 +1,130 @@
+`timescale 1ps/1ps
+
+module gpmc_model_async
+ (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 ctrl;
+ input [10:0] addr;
+ input [15:0] data;
+ begin
+ #23000;
+ EM_A <= addr[10:1];
+ EM_D_int <= data;
+ #20100;
+ if(ctrl)
+ EM_NCS6 <= 0;
+ else
+ EM_NCS4 <= 0;
+ #14000;
+ EM_NWE <= 0;
+ #77500;
+ EM_NCS4 <= 1;
+ EM_NCS6 <= 1;
+ //#1.5;
+ EM_NWE <= 1;
+ #60000;
+ EM_A <= 10'bz;
+ EM_D_int <= 16'bz;
+ end
+ endtask // GPMC_Write
+
+ task GPMC_Read;
+ input ctrl;
+ input [10:0] addr;
+ begin
+ #13000;
+ EM_A <= addr[10:1];
+ #3000;
+ if(ctrl)
+ EM_NCS6 <= 0;
+ else
+ EM_NCS4 <= 0;
+ #14000;
+ EM_NOE <= 0;
+ #77500;
+ EM_NCS4 <= 1;
+ EM_NCS6 <= 1;
+ //#1.5;
+ $display("Data Read from GPMC: %X",EM_D);
+ EM_NOE <= 1;
+ #254000;
+ EM_A <= 10'bz;
+ end
+ endtask // GPMC_Read
+
+ initial
+ begin
+ #1000000;
+ GPMC_Write(1,36,16'hF00D);
+ #1000000;
+ GPMC_Read(1,36);
+ #1000000;
+ GPMC_Write(0,0,16'h1234);
+ GPMC_Write(0,0,16'h5678);
+ GPMC_Write(0,0,16'h9abc);
+ GPMC_Write(0,0,16'hF00D);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ #1000000;
+ GPMC_Write(0,0,16'h1234);
+ GPMC_Write(0,0,16'h5678);
+ GPMC_Write(0,0,16'h9abc);
+ GPMC_Write(0,0,16'hF00D);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'hDEAD);
+ GPMC_Write(0,0,16'h9876);
+ #1000000;
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ #1000000;
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ GPMC_Read(0,0);
+ #1000000;
+ GPMC_Read(0,0);
+ #100000000;
+ $finish;
+ end
+
+endmodule // gpmc_model_async
diff --git a/usrp2/models/gpmc_model_sync.v b/usrp2/models/gpmc_model_sync.v
new file mode 100644
index 000000000..641720c15
--- /dev/null
+++ b/usrp2/models/gpmc_model_sync.v
@@ -0,0 +1,97 @@
+
+
+module gpmc_model_sync
+ (output reg 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 );
+
+ reg [15:0] EM_D_int;
+ assign EM_D = EM_D_int;
+
+ initial
+ begin
+ EM_CLK <= 0;
+ 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 ctrl;
+ input [10:0] addr;
+ input [15:0] data;
+ begin
+ EM_CLK <= 1;
+ #10;
+ EM_CLK <= 0;
+ EM_NWE <= 0;
+ if(ctrl)
+ EM_NCS6 <= 0;
+ else
+ EM_NCS4 <= 0;
+ EM_A <= addr[10:1];
+ EM_D_int <= data;
+ #10;
+ EM_CLK <= 1;
+ #10;
+ EM_CLK <= 0;
+ EM_NWE <= 1;
+ EM_NCS4 <= 1;
+ EM_NCS6 <= 1;
+ EM_A <= 10'bz;
+ EM_D_int <= 16'bz;
+ #100;
+ end
+ endtask // GPMC_Write
+
+ task GPMC_Read;
+ input ctrl;
+ input [10:0] addr;
+ begin
+ #1.3;
+ EM_A <= addr[10:1];
+ #3;
+ if(ctrl)
+ EM_NCS6 <= 0;
+ else
+ EM_NCS4 <= 0;
+ #14;
+ EM_NOE <= 0;
+ #77.5;
+ EM_NCS4 <= 1;
+ EM_NCS6 <= 1;
+ //#1.5;
+ $display("Data Read from GPMC: %X",EM_D);
+ EM_NOE <= 1;
+ #254;
+ EM_A <= 10'bz;
+ end
+ endtask // GPMC_Read
+
+ initial
+ begin
+ #1000;
+ GPMC_Write(1,36,16'hF00D);
+ #1000;
+ GPMC_Read(1,36);
+ #1000;
+ GPMC_Write(0,36,16'h1234);
+ GPMC_Write(0,38,16'h5678);
+ GPMC_Write(0,40,16'h9abc);
+ GPMC_Write(0,11'h2F4,16'hF00D);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ GPMC_Write(0,11'h7FE,16'hDEAD);
+ #100000;
+ $finish;
+ end
+
+endmodule // gpmc_model