2 //Cells still in this file have INCOMPLETE simulation models, need to finish them
4 module GP_DCMP(input[7:0] INP, input[7:0] INN, input CLK, input PWRDN, output reg GREATER, output reg EQUAL);
5 parameter PWRDN_SYNC = 1'b0;
6 parameter CLK_EDGE = "RISING";
7 parameter GREATER_OR_EQUAL = 1'b0;
9 //TODO implement power-down mode
14 wire clk_minv = (CLK_EDGE == "RISING") ? CLK : ~CLK;
15 always @(posedge clk_minv) begin
17 GREATER <= (INP >= INN);
19 GREATER <= (INP > INN);
21 EQUAL <= (INP == INN);
26 module GP_EDGEDET(input IN, output reg OUT);
28 parameter EDGE_DIRECTION = "RISING";
29 parameter DELAY_STEPS = 1;
30 parameter GLITCH_FILTER = 0;
32 //not implemented for simulation
36 module GP_RCOSC(input PWRDN, output reg CLKOUT_HARDIP, output reg CLKOUT_FABRIC);
38 parameter PWRDN_EN = 0;
39 parameter AUTO_PWRDN = 0;
40 parameter HARDIP_DIV = 1;
41 parameter FABRIC_DIV = 1;
42 parameter OSC_FREQ = "25k";
44 initial CLKOUT_HARDIP = 0;
45 initial CLKOUT_FABRIC = 0;
47 //output dividers not implemented for simulation
48 //auto powerdown not implemented for simulation
57 if(OSC_FREQ == "25k") begin
58 //half period of 25 kHz
63 //half period of 2 MHz
67 CLKOUT_HARDIP = ~CLKOUT_HARDIP;
68 CLKOUT_FABRIC = ~CLKOUT_FABRIC;
74 module GP_RINGOSC(input PWRDN, output reg CLKOUT_HARDIP, output reg CLKOUT_FABRIC);
76 parameter PWRDN_EN = 0;
77 parameter AUTO_PWRDN = 0;
78 parameter HARDIP_DIV = 1;
79 parameter FABRIC_DIV = 1;
81 initial CLKOUT_HARDIP = 0;
82 initial CLKOUT_FABRIC = 0;
84 //output dividers not implemented for simulation
85 //auto powerdown not implemented for simulation
93 //half period of 27 MHz
95 CLKOUT_HARDIP = ~CLKOUT_HARDIP;
96 CLKOUT_FABRIC = ~CLKOUT_FABRIC;
108 output reg[7:0] RXD_HIGH,
109 output reg[7:0] RXD_LOW,
112 initial RXD_HIGH = 0;
116 parameter DATA_WIDTH = 8; //byte or word width
117 parameter SPI_CPHA = 0; //SPI clock phase
118 parameter SPI_CPOL = 0; //SPI clock polarity
119 parameter DIRECTION = "INPUT"; //SPI data direction (either input to chip or output to host)
120 //parallel output to fabric not yet implemented
122 //TODO: write sim model
123 //TODO: SPI SDIO control... can we use ADC output while SPI is input??
128 //keep constraint needed to prevent optimization since we have no outputs
130 module GP_SYSRESET(input RST);
131 parameter RESET_MODE = "EDGE";
132 parameter EDGE_SPEED = 4;
134 //cannot simulate whole system reset