File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 2
2
from .la_vinv .la_vinv import Vinv
3
3
from .la_vmux .la_vmux import Vmux
4
4
from .la_vmux2 .la_vmux2 import Vmux2
5
+ from .la_vmux2 .la_vmux2b import Vmux2b
5
6
from .la_vmux3 .la_vmux3 import Vmux3
6
7
from .la_vmux4 .la_vmux4 import Vmux4
7
8
from .la_vmux5 .la_vmux5 import Vmux5
13
14
'Vinv' ,
14
15
'Vmux' ,
15
16
'Vmux2' ,
17
+ 'Vmux2b' ,
16
18
'Vmux3' ,
17
19
'Vmux4' ,
18
20
'Vmux5' ,
Original file line number Diff line number Diff line change
1
+ from lambdalib import Lambda
2
+
3
+
4
+ class Vmux2b (Lambda ):
5
+ def __init__ (self ):
6
+ name = 'la_vmux2'
7
+ sources = [f'rtl/{ name } .v' ]
8
+ super ().__init__ (name , sources , __file__ )
9
+
10
+
11
+ if __name__ == "__main__" :
12
+ d = Vmux2b ()
13
+ d .write_fileset (f"{ d .name ()} .f" , fileset = "rtl" )
Original file line number Diff line number Diff line change
1
+ // ############################################################################
2
+ // # Function: 2-Input one-hot vectorized mux #
3
+ // # Copyright: Lambda Project Authors. All rights Reserved. #
4
+ // # License: MIT (see LICENSE file in Lambda repository) #
5
+ // ############################################################################
6
+
7
+ module la_vmux2 #(parameter W = 1 , // width of mux
8
+ parameter PROP = "DEFAULT" // cell property
9
+ )
10
+ (
11
+ input sel,
12
+ input [W- 1 :0 ] in1,
13
+ input [W- 1 :0 ] in0,
14
+ output [W- 1 :0 ] out
15
+ );
16
+
17
+ assign out[W- 1 :0 ] = ({(W) {~ sel}} & in0[W- 1 :0 ] |
18
+ {(W) {sel}} & in1[W- 1 :0 ]);
19
+
20
+ endmodule
You can’t perform that action at this time.
0 commit comments