1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-17 20:02:53 +08:00

Xilinx models

-adding ODDR model
-configuring the ecfg (rx/tx/clk) in testbench
This commit is contained in:
Andreas Olofsson 2015-04-15 17:54:19 -04:00
parent bdec6c1067
commit b1a9f502ca
3 changed files with 167 additions and 145 deletions

View File

@ -31,8 +31,13 @@ module dv_elink_tb();
clk = 1'b0;
datamode = 2'b11;
#400
//Setting config clocks to higher value to speed sims
//clock config
dv_elink.elink.ecfg.ecfg_clk_reg[15:0] = 16'h0066;
//tx config
dv_elink.elink.ecfg.ecfg_tx_reg[8:0] = 9'h001;
//rx config
dv_elink.elink.ecfg.ecfg_tx_reg[4:0] = 5'h01;
reset = 1'b0; // at time 100 release reset
#1000

View File

@ -8,11 +8,10 @@ module OBUFTDS (/*AUTOARG*/
parameter IOSTANDARD=0;
parameter SLEW=0;
input I;
input T;
output O;
output OB;
input I; //input
input T; //tristate signal
output O; //output
output OB; //output_bar
assign O = T ? 1'bz : I;
assign OB = T ? 1'bz : ~I;

View File

@ -5,19 +5,37 @@ module ODDR (/*AUTOARG*/
C, CE, D1, D2, R, S
);
parameter DDR_CLK_EDGE=0;
parameter INIT=0;
parameter SRTYPE=0;
parameter DDR_CLK_EDGE=0; //clock recovery mode
parameter INIT=0; //Q init value
parameter SRTYPE=0;//"SYNC", "ASYNC"
input C;
input CE;
input D1;
input D2;
input R;
input S;
output Q;
input C; // Clock input
input CE; // Clock enable input
input D1; // Data input1
input D2; // Data input2
input R; // Reset (depends on SRTYPE)
input S; // Active high asynchronous pin
output Q; // Data Output that connects to the IOB pad
assign Q=1'b0;
reg Q1,Q2;
//Generate different logic based on parameters
//Only doing same edge and async reset for now
always @ (posedge C or posedge R)
if (R)
Q1 <= 1'b0;
else
Q1 <= D1;
always @ (posedge C or posedge R)
if (R)
Q2 <= 1'b0;
else
Q2 <= D2;
assign Q = C ? Q1 : Q2;
endmodule // ODDR