@@ -16,17 +16,21 @@ def encode_version(version):
16
16
return r
17
17
18
18
class Identifier :
19
- def __init__ (self , address , sysid , version ):
19
+ def __init__ (self , address , sysid , version , frequency ):
20
20
self .sysid = sysid
21
21
self .version = encode_version (version )
22
+ self .frequency = frequency
22
23
23
24
self ._r_sysid = RegisterField ("sysid" , 16 , access_bus = READ_ONLY , access_dev = WRITE_ONLY )
24
25
self ._r_version = RegisterField ("version" , 16 , access_bus = READ_ONLY , access_dev = WRITE_ONLY )
25
- self .bank = csrgen .Bank ([self ._r_sysid , self ._r_version ], address = address )
26
+ self ._r_frequency = RegisterField ("frequency" , 32 , access_bus = READ_ONLY , access_dev = WRITE_ONLY )
27
+ regs = [self ._r_sysid , self ._r_version , self ._r_frequency ]
28
+ self .bank = csrgen .Bank (regs , address = address )
26
29
27
30
def get_fragment (self ):
28
31
comb = [
29
32
self ._r_sysid .field .w .eq (self .sysid ),
30
- self ._r_version .field .w .eq (self .version )
33
+ self ._r_version .field .w .eq (self .version ),
34
+ self ._r_frequency .field .w .eq (self .frequency )
31
35
]
32
36
return self .bank .get_fragment () + Fragment (comb )
0 commit comments