mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-17 20:02:53 +08:00
Major reorg!
-stdcells moved to asiclib, doesn't make sense to be vectorized -common is a stupid name, renamed as stdlib
This commit is contained in:
parent
3cb916f4b5
commit
de63dfd907
@ -17,7 +17,7 @@ module emesh_readback (/*AUTOARG*/
|
||||
output ready_out; // pushback from mesh
|
||||
|
||||
// register/memory data (already pipelined)
|
||||
input [63:0] read_data; // data from register/memory
|
||||
input [63:0] read_data; // data from register/memorye
|
||||
|
||||
// output transaction
|
||||
output access_out; // register access
|
||||
@ -45,8 +45,8 @@ module emesh_readback (/*AUTOARG*/
|
||||
//# Parse packet
|
||||
//#######################################
|
||||
|
||||
packet2emesh #(.AW(AW),
|
||||
.PW(PW))
|
||||
enoc_unpack #(.AW(AW),
|
||||
.PW(PW))
|
||||
p2e (/*AUTOINST*/
|
||||
// Outputs
|
||||
.write_in (write_in),
|
||||
@ -88,8 +88,8 @@ module emesh_readback (/*AUTOARG*/
|
||||
//# Convert to Packet
|
||||
//#######################################
|
||||
|
||||
emesh2packet #(.AW(AW),
|
||||
.PW(PW))
|
||||
enoc_pack #(.AW(AW),
|
||||
.PW(PW))
|
||||
e2p (.write_out (1'b1),
|
||||
/*AUTOINST*/
|
||||
// Outputs
|
||||
|
@ -74,8 +74,8 @@ module gpio #( parameter integer N = 24, // number of gpio pins
|
||||
//# DECODE LOGIC
|
||||
//################################
|
||||
|
||||
packet2emesh #(.AW(AW),
|
||||
.PW(PW))
|
||||
enoc_unpack #(.AW(AW),
|
||||
.PW(PW))
|
||||
p2e(
|
||||
/*AUTOINST*/
|
||||
// Outputs
|
||||
|
@ -9,24 +9,13 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
DUT=$1
|
||||
|
||||
##############################
|
||||
#Create directory of all links
|
||||
##############################
|
||||
$OH_HOME/scripts/link.sh
|
||||
|
||||
##############################
|
||||
#Build
|
||||
###############################
|
||||
iverilog -g2005\
|
||||
-DTARGET_SIM=1\
|
||||
-DCFG_ASIC=0\
|
||||
-DCFG_PLATFORM=\"ZYNQ\"\
|
||||
$DUT\
|
||||
$OH_HOME/symlinks/dv/dv_top.v\
|
||||
-y .\
|
||||
-y $OH_HOME/symlinks/hdl\
|
||||
-y $OH_HOME/symlinks/dv\
|
||||
-I $OH_HOME/symlinks/hdl\
|
||||
-o dut.bin\
|
||||
-f $OH_HOME/scripts/libs.cmd \
|
||||
-o dut.bin $1
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
common/hdl/*.v
|
||||
|
||||
list=(accelerator elink emailbox emmu gpio mio pic spi)
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2 Input And Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_and2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a & b;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3 Input And Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_and3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a & b & c;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4 Input And Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_and4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a&b&c&d);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao21) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao21 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1) | b0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao211) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao211 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1) | b0 | c0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao22) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao22 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1) | (b0 & b1);
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao221) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao221 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1) | (b0 & b1) | (c0);
|
||||
|
||||
endmodule
|
@ -1,21 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao222) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao222 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
input [DW-1:0] c1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1) | (b0 & b1) | (c0 & c1);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao31) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao31 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1 & a2) | b0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao311) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao311 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1 & a2) | b0 | c0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao32) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao32 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1 & a2) | (b0 & b1);
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or (ao33) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_ao33 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] b2,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 & a1 & a2) | (b0 & b1 & b2);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi21) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi21 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1) | b0);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi211) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi211 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1) | b0 | c0);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi22) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi22 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1) | (b0 & b1));
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi221) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi221 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1) | (b0 & b1) | c0);
|
||||
|
||||
endmodule
|
@ -1,21 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi222) Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi222 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
input [DW-1:0] c1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1) | (b0 & b1) | (c0 & c1));
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi31) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi31 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1 & a2) | b0);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi311) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi311 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1 & a2) | b0 | c0);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi32) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi32 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1 & a2) | (b0 & b1));
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: And-Or-Inverter (aoi33) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_aoi33 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] b2,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 & a1 & a2) | (b0 & b1 & b2));
|
||||
|
||||
endmodule
|
@ -1,15 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Non-inverting Buffer #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_buf #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a;
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Negative edge-triggered static D-type flop-flop #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffnq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (negedge clk)
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop #
|
||||
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk)
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered inverting static D-type flop-flop #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk)
|
||||
qn <= ~d;
|
||||
|
||||
endmodule
|
@ -1,23 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop with async #
|
||||
//# active low reset. #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffrq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nreset,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nreset)
|
||||
if(!nreset)
|
||||
q <= 'b0;
|
||||
else
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,22 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static inverting D-type flop-flop with #
|
||||
// async active low reset. #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffrqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nreset,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nreset)
|
||||
if(!nreset)
|
||||
qn <= {DW{1'b1}};
|
||||
else
|
||||
qn <= ~d;
|
||||
|
||||
endmodule
|
@ -1,22 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop with async #
|
||||
//# active low preset. #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffsq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nset,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nset)
|
||||
if(!nset)
|
||||
q <= {DW{1'b1}};
|
||||
else
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,22 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static inverting D-type flop-flop with #
|
||||
// async active low set. #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_dffsqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nset,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nset)
|
||||
if(!nset)
|
||||
qn <= 'b0;
|
||||
else
|
||||
qn <= ~d;
|
||||
|
||||
endmodule
|
@ -1,15 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Inverter #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_inv #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~a;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: D-type active-low transparent latch #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_latnq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] gn,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always_latch
|
||||
if(!gn)
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: D-type active-high transparent latch #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_latq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] g,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always_latch
|
||||
if(g)
|
||||
q <= d;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2-Input Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mx2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] s,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (d0 & ~s) | (d1 & s);
|
||||
|
||||
endmodule
|
@ -1,22 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3-Input Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mx3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] d2,
|
||||
input [DW-1:0] s0,
|
||||
input [DW-1:0] s1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (d0 & ~s0 & ~s1) |
|
||||
(d1 & s0 & ~s1) |
|
||||
(d2 & s1);
|
||||
|
||||
endmodule
|
@ -1,24 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4-Input Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mx4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] d2,
|
||||
input [DW-1:0] d3,
|
||||
input [DW-1:0] s0,
|
||||
input [DW-1:0] s1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (d0 & ~s1 & ~s0) |
|
||||
(d1 & ~s1 & s0) |
|
||||
(d2 & s1 & ~s0) |
|
||||
(d2 & s1 & s0);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2-Input Inverting Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mxi2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] s,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((d0 & ~s) | (d1 & s));
|
||||
|
||||
endmodule
|
@ -1,22 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3-Input Inverting Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mxi3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] d2,
|
||||
input [DW-1:0] s0,
|
||||
input [DW-1:0] s1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((d0 & ~s0 & ~s1) |
|
||||
(d1 & s0 & ~s1) |
|
||||
(d2 & s1));
|
||||
|
||||
endmodule
|
@ -1,24 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4-Input Inverting Mux #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_mxi4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] d0,
|
||||
input [DW-1:0] d1,
|
||||
input [DW-1:0] d2,
|
||||
input [DW-1:0] d3,
|
||||
input [DW-1:0] s0,
|
||||
input [DW-1:0] s1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((d0 & ~s1 & ~s0) |
|
||||
(d1 & ~s1 & s0) |
|
||||
(d2 & s1 & ~s0) |
|
||||
(d2 & s1 & s0));
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3 Input Nand Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_nand3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a & b & c);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4 Input Nand Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_nand4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a & b & c & d);
|
||||
|
||||
endmodule
|
@ -1,16 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2 Input Nor Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_nor2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a | b);
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3 Input Nor Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_nor3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a | b | c);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4 Input Nor Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_nor4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a | b | c | d);
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa21) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa21 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1) & b0;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa211) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa211 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1) & b0 & c0;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa22) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa22 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1) & (b0 | b1);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa221) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa221 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1) & (b0 | b1) & (c0);
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa222) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa222 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
input [DW-1:0] c1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1) & (b0 | b1) & (c0 | c1);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa31) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa31 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1 | a2) & b0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa311) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa311 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1 | a2) & b0 & c0;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa32) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa32 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1 | a2) & (b0 | b1);
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And (oa33) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oa33 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] b2,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = (a0 | a1 | a2) & (b0 | b1 | b2);
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai21) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai21 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1) & b0);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai22) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai22 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1) & (b0 | b1));
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai221) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai221 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1) & (b0 | b1) & (c0));
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai222) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai222 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] c0,
|
||||
input [DW-1:0] c1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1) & (b0 | b1) & (c0 | c1));
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai31) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai31 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1 | a2) & b0);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai311) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai311 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] c0,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1 | a2) & b0 & c0);
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai32) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai32 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1 | a2) & (b0 | b1));
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Or-And-Inverter (oai33) Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_oai33 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a0,
|
||||
input [DW-1:0] a1,
|
||||
input [DW-1:0] a2,
|
||||
input [DW-1:0] b0,
|
||||
input [DW-1:0] b1,
|
||||
input [DW-1:0] b2,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~((a0 | a1 | a2) & (b0 | b1 | b2));
|
||||
|
||||
endmodule
|
@ -1,16 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2 Input Or Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_or2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ( a | b);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3 Input Or Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_or3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a | b | c ;
|
||||
|
||||
endmodule
|
@ -1,19 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4 Input Or Gate #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_or4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a | b | c | d;
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop with scan input #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk)
|
||||
q <= se ? si : d;
|
||||
|
||||
endmodule
|
@ -1,20 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered inverting static D-type flop-flop #
|
||||
//# with scan input. #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk)
|
||||
qn <= se ? ~si : ~d;
|
||||
|
||||
endmodule
|
@ -1,25 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop with async #
|
||||
//# active low reset and scan input #
|
||||
//# #
|
||||
//# Copyright: OH Project Authors. All rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffrq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nreset,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nreset)
|
||||
if(!nreset)
|
||||
q <= 'b0;
|
||||
else
|
||||
q <= se ? si : d;
|
||||
|
||||
endmodule
|
@ -1,24 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static inverting D-type flop-flop with #
|
||||
// async active low reset and scan input #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffrqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nreset,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nreset)
|
||||
if(!nreset)
|
||||
qn <= {DW{1'b1}};
|
||||
else
|
||||
qn <= se ? ~si : ~d;
|
||||
|
||||
endmodule
|
@ -1,24 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static D-type flop-flop with async #
|
||||
//# active low preset and scan input. #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffsq #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nset,
|
||||
output reg [DW-1:0] q
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nset)
|
||||
if(!nset)
|
||||
q <= {DW{1'b1}};
|
||||
else
|
||||
q <= se ? si : d;
|
||||
|
||||
endmodule
|
@ -1,24 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: Positive edge-triggered static inverting D-type flop-flop with #
|
||||
// async active low set and scan input #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_sdffsqn #(parameter DW = 1) // array width
|
||||
(
|
||||
input [DW-1:0] d,
|
||||
input [DW-1:0] si,
|
||||
input [DW-1:0] se,
|
||||
input [DW-1:0] clk,
|
||||
input [DW-1:0] nset,
|
||||
output reg [DW-1:0] qn
|
||||
);
|
||||
|
||||
always @ (posedge clk or negedge nset)
|
||||
if(!nset)
|
||||
qn <= 'b0;
|
||||
else
|
||||
qn <= se ? ~si : ~d;
|
||||
|
||||
endmodule
|
@ -1,16 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2-Input Exclusive-NOr Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xnor2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a ^ b);
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3-Input Exclusive-NOr Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xnor3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a ^ b ^ c);
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4-Input Exclusive-NOr Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xnor4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = ~(a ^ b ^ c ^ d);
|
||||
|
||||
endmodule
|
@ -1,16 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 2-Input Exclusive-Or Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xor2 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a ^ b;
|
||||
|
||||
endmodule
|
@ -1,17 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 3-Input Exclusive-Or Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xor3 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a ^ b ^ c;
|
||||
|
||||
endmodule
|
@ -1,18 +0,0 @@
|
||||
//#############################################################################
|
||||
//# Function: 4-Input Exclusive-Or Gate #
|
||||
//# Copyright: OH Project Authors. ALl rights Reserved. #
|
||||
//# License: MIT (see LICENSE file in OH repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_xor4 #(parameter DW = 1 ) // array width
|
||||
(
|
||||
input [DW-1:0] a,
|
||||
input [DW-1:0] b,
|
||||
input [DW-1:0] c,
|
||||
input [DW-1:0] d,
|
||||
output [DW-1:0] z
|
||||
);
|
||||
|
||||
assign z = a ^ b ^ c ^ d;
|
||||
|
||||
endmodule
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user