diff options
author | Andrew Zonenberg <azonenberg@drawersteak.com> | 2016-12-17 12:01:22 +0800 |
---|---|---|
committer | Andrew Zonenberg <azonenberg@drawersteak.com> | 2016-12-17 12:01:22 +0800 |
commit | de1d81511af7a5ca362c334635190609c45e998b (patch) | |
tree | 8ec8665a97f5845b03db32e0a6e1921c6ac2a9a9 /techlibs | |
parent | 7cdba8432cae3ebd076b13d3b2b17d40683ef97a (diff) | |
download | yosys-de1d81511af7a5ca362c334635190609c45e998b.tar.gz yosys-de1d81511af7a5ca362c334635190609c45e998b.tar.bz2 yosys-de1d81511af7a5ca362c334635190609c45e998b.zip |
greenpak4: Updated GP_DCMP cell model
Diffstat (limited to 'techlibs')
-rw-r--r-- | techlibs/greenpak4/cells_sim.v | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/techlibs/greenpak4/cells_sim.v b/techlibs/greenpak4/cells_sim.v index 0f1eaf8fb..27c5ff054 100644 --- a/techlibs/greenpak4/cells_sim.v +++ b/techlibs/greenpak4/cells_sim.v @@ -136,8 +136,26 @@ module GP_DAC(input[7:0] DIN, input wire VREF, output reg VOUT); endmodule -module GP_DCMP(input[7:0] INP, input[7:0] INN, input CLK, input PWRDN, output reg OUTP, output reg OUTN); - //TODO finish implementing +module GP_DCMP(input[7:0] INP, input[7:0] INN, input CLK, input PWRDN, output reg GREATER, output reg EQUAL); + parameter PWRDN_SYNC = 1'b0; + parameter CLK_EDGE = "RISING"; + parameter GREATER_OR_EQUAL = 1'b0; + + //TODO implement power-down mode + + initial GREATER = 0; + initial EQUAL = 0; + + wire clk_minv = (CLK_EDGE == "RISING") ? CLK : ~CLK; + always @(posedge clk_minv) begin + if(GREATER_OR_EQUAL) + GREATER <= (INP >= INN); + else + GREATER <= (INP > INN); + + EQUAL <= (INP == INN); + end + endmodule module GP_DCMPREF(output reg[7:0]OUT); |