From 59e8d046daa3f5afbb6f9046145345e40c3cc535 Mon Sep 17 00:00:00 2001 From: aolofsson Date: Sat, 24 Jul 2021 23:29:50 -0400 Subject: [PATCH] Compilation cleanup --- common/hdl/oh_7seg_decode.v | 58 ++++----- common/hdl/oh_bitreverse.v | 25 ++-- common/hdl/oh_counter.v | 43 +++---- common/hdl/oh_crc.v | 40 ------ common/hdl/oh_crc32_64b.v | 79 ------------ common/hdl/oh_crc32_8b.v | 81 ------------ common/hdl/oh_debouncer.v | 61 +++++---- common/hdl/oh_dsync.v | 52 ++++---- common/hdl/oh_fifo_async.v | 247 +++++++++++++++++++++++++++--------- common/hdl/oh_fifo_sync.v | 47 ++++--- common/hdl/oh_iddr.v | 15 +-- common/hdl/oh_lat0.v | 10 +- common/hdl/oh_lat1.v | 10 +- common/hdl/oh_memory.v | 2 +- common/hdl/oh_mux12.v | 60 ++++----- common/hdl/oh_ram.v | 44 ++++--- common/hdl/oh_regfile.v | 57 ++++----- 17 files changed, 423 insertions(+), 508 deletions(-) delete mode 100644 common/hdl/oh_crc.v delete mode 100644 common/hdl/oh_crc32_64b.v delete mode 100644 common/hdl/oh_crc32_8b.v diff --git a/common/hdl/oh_7seg_decode.v b/common/hdl/oh_7seg_decode.v index e9fa033..86d33ce 100644 --- a/common/hdl/oh_7seg_decode.v +++ b/common/hdl/oh_7seg_decode.v @@ -2,38 +2,38 @@ //# Function: BCD Seven Segment Decoderh # //############################################################################# //# Author: Andreas Olofsson # -//# License: MIT (see LICENSE file in OH! repository) # +//# License: MIT (see LICENSE file in OH! repository) # //############################################################################# -module oh_7seg_decode ( input [3:0] bcd, //0-9 - output a, //a segment (1=0ff) - output b, //b segment - output c, //c segment - output d, //d segment - output e, //e segment - output f, //f segment - output g //g segment - ); +module oh_7seg_decode + ( input [3:0] bcd, //0-9 + output a, //a segment (1=0ff) + output b, //b segment + output c, //c segment + output d, //d segment + output e, //e segment + output f, //f segment + output g //g segment + ); - reg a,b,c,d,e,f,g; - - always @ (*) - case(bcd[3:0]) - 4'h0 : {a,b,c,d,e,f,g} = 7'b0000001; - 4'h1 : {a,b,c,d,e,f,g} = 7'b1001111; - 4'h2 : {a,b,c,d,e,f,g} = 7'b0010010; - 4'h3 : {a,b,c,d,e,f,g} = 7'b0000110; - 4'h4 : {a,b,c,d,e,f,g} = 7'b1001100; - 4'h5 : {a,b,c,d,e,f,g} = 7'b0100100; - 4'h6 : {a,b,c,d,e,f,g} = 7'b0100000; - 4'h7 : {a,b,c,d,e,f,g} = 7'b0001111; - 4'h8 : {a,b,c,d,e,f,g} = 7'b0000000; - 4'h9 : {a,b,c,d,e,f,g} = 7'b0001100; - default : {a,b,c,d,e,f,g} = 7'b1111111; - endcase // case (in[3:0]) - -endmodule - + assign a = (bcd[3:0] == 4'h1) | (bcd[3:0] == 4'h4); + + assign b = (bcd[3:0] == 4'h5) | (bcd[3:0] == 4'h6); + + assign c = (bcd[3:0] == 4'h2); + + assign d = (bcd[3:0] == 4'h1) | (bcd[3:0] == 4'h4)| + (bcd[3:0] == 4'h7) | (bcd[3:0] == 4'h9); + + assign e = (bcd[3:0] == 4'h1) | (bcd[3:0] == 4'h3)| + (bcd[3:0] == 4'h4) | (bcd[3:0] == 4'h5)| + (bcd[3:0] == 4'h7) | (bcd[3:0] == 4'h9); + + assign f = (bcd[3:0] == 4'h1) | (bcd[3:0] == 4'h2)| + (bcd[3:0] == 4'h3) | (bcd[3:0] == 4'h7); + assign g = (bcd[3:0] == 4'h0) | (bcd[3:0] == 4'h1) | + (bcd[3:0] == 4'h7); +endmodule // oh_7seg_decode diff --git a/common/hdl/oh_bitreverse.v b/common/hdl/oh_bitreverse.v index d7cda2c..7f77a9d 100644 --- a/common/hdl/oh_bitreverse.v +++ b/common/hdl/oh_bitreverse.v @@ -2,7 +2,7 @@ //# Function: Binary to one hot encoder # //############################################################################# //# Author: Andreas Olofsson # -//# License: MIT (see LICENSE file in OH! repository) # +//# License: MIT (see LICENSE file in OH! repository) # //############################################################################# module oh_bitreverse #(parameter DW = 32 // width of data inputs @@ -11,19 +11,12 @@ module oh_bitreverse #(parameter DW = 32 // width of data inputs input [DW-1:0] in, // data input output [DW-1:0] out // bit reversed output ); - - - reg [DW-1:0] out; - integer i; - - always @* - for (i=0;i