-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.temp
55 lines (39 loc) · 1.38 KB
/
.temp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#=========================================================================
# GCD Unit RTL Datapath
#=========================================================================
class GcdUnitDpathRTL (Model):
# Constructor
def __init__( s ):
#---------------------------------------------------------------------
# Interface
#---------------------------------------------------------------------
s.req_msg_a = InPort (16)
s.req_msg_b = InPort (16)
s.resp_msg = OutPort (16)
# Control signals (ctrl -> dpath)
s.a_mux_sel = InPort (A_MUX_SEL_NBITS)
s.a_reg_en = InPort (1)
s.b_mux_sel = InPort (B_MUX_SEL_NBITS)
s.b_reg_en = InPort (1)
# Status signals (dpath -> ctrl)
s.is_b_zero = OutPort (1)
s.is_a_lt_b = OutPort (1)
#---------------------------------------------------------------------
# Structural composition
#---------------------------------------------------------------------
# A mux
s.sub_out = Wire(16)
s.b_reg_out = Wire(16)
s.a_mux = m = Mux( 16, 3 )
s.connect_dict({
m.sel : s.a_mux_sel,
m.in_[ A_MUX_SEL_IN ] : s.req_msg_a,
m.in_[ A_MUX_SEL_SUB ] : s.sub_out,
m.in_[ A_MUX_SEL_B ] : s.b_reg_out,
})
# A register
s.a_reg = m = RegEn(16)
s.connect_dict({
m.en : s.a_reg_en,
m.in_ : s.a_mux.out,
})