summaryrefslogtreecommitdiffstats
path: root/usrp2/models/gpmc_model.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-02-25 16:50:09 -0800
committerMatt Ettus <matt@ettus.com>2010-02-25 16:50:09 -0800
commit030f6a21539207c058b982ffade384ec7a937ec2 (patch)
tree8432bb4f2536604762a81b1c6847687bb77c2819 /usrp2/models/gpmc_model.v
parent0d9c46ae002cad7c144432e86987a81eb33157fc (diff)
downloaduhd-030f6a21539207c058b982ffade384ec7a937ec2.tar.gz
uhd-030f6a21539207c058b982ffade384ec7a937ec2.tar.bz2
uhd-030f6a21539207c058b982ffade384ec7a937ec2.zip
First cut at passing data buffers around on GPMC bus
Diffstat (limited to 'usrp2/models/gpmc_model.v')
-rw-r--r--usrp2/models/gpmc_model.v23
1 files changed, 19 insertions, 4 deletions
diff --git a/usrp2/models/gpmc_model.v b/usrp2/models/gpmc_model.v
index 38dde1fa5..1e7dcdde5 100644
--- a/usrp2/models/gpmc_model.v
+++ b/usrp2/models/gpmc_model.v
@@ -22,6 +22,7 @@ module gpmc_model
end
task GPMC_Write;
+ input ctrl;
input [10:0] addr;
input [15:0] data;
begin
@@ -29,10 +30,14 @@ module gpmc_model
EM_A <= addr[10:1];
EM_D_int <= data;
#2.01;
- EM_NCS6 <= 0;
+ if(ctrl)
+ EM_NCS6 <= 0;
+ else
+ EM_NCS4 <= 0;
#14;
EM_NWE <= 0;
#77.5;
+ EM_NCS4 <= 1;
EM_NCS6 <= 1;
//#1.5;
EM_NWE <= 1;
@@ -43,15 +48,20 @@ module gpmc_model
endtask // GPMC_Write
task GPMC_Read;
+ input ctrl;
input [10:0] addr;
begin
#1.3;
EM_A <= addr[10:1];
#3;
- EM_NCS6 <= 0;
+ 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);
@@ -64,9 +74,14 @@ module gpmc_model
initial
begin
#1000;
- GPMC_Write(36,16'hBEEF);
+ GPMC_Write(1,36,16'hF00D);
#1000;
- GPMC_Read(36);
+ GPMC_Read(1,36);
+ #1000;
+ GPMC_Write(0,36,16'hF00D);
+ GPMC_Write(0,38,16'hF00D);
+ GPMC_Write(0,40,16'hF00D);
+ GPMC_Write(0,11'h7FFE,16'hF00D);
#1000;
$finish;
end