Skip to content

Commit 034f1cc

Browse files
committed
Adding vectorized cells.
- Used in various places that were relying on now deprecated oh library
1 parent f0e8528 commit 034f1cc

File tree

9 files changed

+134
-2
lines changed

9 files changed

+134
-2
lines changed

lambdalib/veclib/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
from siliconcompiler import Design
22

33
from .la_vbuf.la_vbuf import Vbuf
4+
from .la_ldffnq.la_ldffnq import Vdffnq
5+
from .la_ldffq.la_ldffq import Vdffq
46
from .la_vinv.la_vinv import Vinv
7+
from .la_latnq.la_latnq import Vlatnq
8+
from .la_latq.la_latq import Vlatq
59
from .la_vmux.la_vmux import Vmux
610
from .la_vmux2b.la_vmux2b import Vmux2b
711
from .la_vmux2.la_vmux2 import Vmux2
@@ -11,10 +15,13 @@
1115
from .la_vmux6.la_vmux6 import Vmux6
1216
from .la_vmux7.la_vmux7 import Vmux7
1317
from .la_vmux8.la_vmux8 import Vmux8
14-
from .la_vpriority.la_vpriority import Vpriority
1518

1619
__all__ = ['Vbuf',
20+
'Vdffnq',
21+
'Vdffq',
1722
'Vinv',
23+
'Vlatnq',
24+
'Vlatq',
1825
'Vmux',
1926
'Vmux2',
2027
'Vmux2b',
@@ -24,7 +31,6 @@
2431
'Vmux6',
2532
'Vmux7',
2633
'Vmux8',
27-
'Vpriority'
2834
]
2935

3036

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from lambdalib.lambdalib import Lambda
2+
3+
4+
class Vdffnq(Lambda):
5+
def __init__(self):
6+
name = 'la_dffnq'
7+
super().__init__(name, __file__)
8+
9+
10+
if __name__ == "__main__":
11+
d = Vdffnq()
12+
d.write_fileset(f"{d.name}.f", fileset="rtl")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//#############################################################################
2+
//# Function: Vectorized negative edge-triggered static D-type flop-flop #
3+
//# Copyright: Lambda Project Authors. All rights Reserved. #
4+
//# License: MIT (see LICENSE file in Lambda repository) #
5+
//#############################################################################
6+
7+
module la_dffnq #(parameter W = 1, // width of mux
8+
parameter PROP = "" // cell property
9+
)
10+
(
11+
input [W-1:0] d,
12+
input clk,
13+
output reg [W-1:0] q
14+
);
15+
16+
always @(negedge clk)
17+
q <= d;
18+
19+
endmodule
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from lambdalib.lambdalib import Lambda
2+
3+
4+
class Vdffq(Lambda):
5+
def __init__(self):
6+
name = 'la_dffq'
7+
super().__init__(name, __file__)
8+
9+
10+
if __name__ == "__main__":
11+
d = Vdffq()
12+
d.write_fileset(f"{d.name}.f", fileset="rtl")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//#############################################################################
2+
//# Function: Vectorized positive edge-triggered static D-type flop-flop #
3+
//# Copyright: Lambda Project Authors. All rights Reserved. #
4+
//# License: MIT (see LICENSE file in Lambda repository) #
5+
//#############################################################################
6+
7+
module la_vdffq #(parameter W = 1, // width of mux
8+
parameter PROP = "" // cell property
9+
)
10+
(
11+
input [W-1:0] d,
12+
input clk,
13+
output reg [W-1:0] q
14+
);
15+
16+
always @(posedge clk)
17+
q <= d;
18+
19+
endmodule
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from lambdalib.lambdalib import Lambda
2+
3+
4+
class Vlatnq(Lambda):
5+
def __init__(self):
6+
name = 'la_vlatnq'
7+
super().__init__(name, __file__)
8+
9+
10+
if __name__ == "__main__":
11+
d = Vlatnq()
12+
d.write_fileset(f"{d.name}.f", fileset="rtl")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//#############################################################################
2+
//# Function: Vectorized D-type active-low transparent latch #
3+
//# Copyright: Lambda Project Authors. All rights Reserved. #
4+
//# License: MIT (see LICENSE file in Lambda repository) #
5+
//#############################################################################
6+
7+
module la_vlatnq #(parameter W = 1, // width of mux
8+
parameter PROP = "" // cell property
9+
)
10+
(
11+
input [W-1:0] d,
12+
input clk,
13+
output reg [W-1:0] q
14+
);
15+
16+
always @(clk or d)
17+
if (~clk)
18+
q <= d;
19+
20+
endmodule
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from lambdalib.lambdalib import Lambda
2+
3+
4+
class Vlatnq(Lambda):
5+
def __init__(self):
6+
name = 'la_vlatq'
7+
super().__init__(name, __file__)
8+
9+
10+
if __name__ == "__main__":
11+
d = Vlatq()
12+
d.write_fileset(f"{d.name}.f", fileset="rtl")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//#############################################################################
2+
//# Function: Vectorized D-type active-high transparent latch #
3+
//# Copyright: Lambda Project Authors. All rights Reserved. #
4+
//# License: MIT (see LICENSE file in Lambda repository) #
5+
//#############################################################################
6+
7+
module la_vlatq #(parameter W = 1, // width of mux
8+
parameter PROP = "" // cell property
9+
)
10+
(
11+
input [W-1:0] d,
12+
input clk,
13+
output reg [W-1:0] q
14+
);
15+
16+
always @ (clk or d)
17+
if (clk)
18+
q <= d;
19+
20+
endmodule

0 commit comments

Comments
 (0)