@@ -28,6 +28,8 @@ class Constants:
2828
2929 __MAX_BUNDLE_SIZE : int
3030 __XINSTRUCTION_SIZE_BYTES : int
31+ __CINSTRUCTION_SIZE_BYTES : int
32+ __MINSTRUCTION_SIZE_BYTES : int
3133
3234 # Data Constants
3335 # --------------
@@ -78,6 +80,16 @@ def XINSTRUCTION_SIZE_BYTES(cls) -> int:
7880 """Size of an x-instruction in bytes."""
7981 return cls .__XINSTRUCTION_SIZE_BYTES
8082
83+ @classproperty
84+ def CINSTRUCTION_SIZE_BYTES (cls ) -> int :
85+ """Size of a c-instruction in bytes."""
86+ return cls .__CINSTRUCTION_SIZE_BYTES
87+
88+ @classproperty
89+ def MINSTRUCTION_SIZE_BYTES (cls ) -> int :
90+ """Size of a m-instruction in bytes."""
91+ return cls .__MINSTRUCTION_SIZE_BYTES
92+
8193 @classproperty
8294 def MAX_BUNDLE_SIZE (cls ) -> int :
8395 """Maximum number of instructions in a bundle."""
@@ -124,7 +136,12 @@ def hw_spec_as_dict(cls) -> dict:
124136 """
125137 Returns hw configurable attributes as dictionary.
126138 """
127- return {"bytes_per_xinstruction" : cls .XINSTRUCTION_SIZE_BYTES , "max_instructions_per_bundle" : cls .MAX_BUNDLE_SIZE }
139+ return {
140+ "bytes_per_xinstruction" : cls .XINSTRUCTION_SIZE_BYTES ,
141+ "bytes_per_cinstruction" : cls .CINSTRUCTION_SIZE_BYTES ,
142+ "bytes_per_minstruction" : cls .MINSTRUCTION_SIZE_BYTES ,
143+ "max_instructions_per_bundle" : cls .MAX_BUNDLE_SIZE ,
144+ }
128145
129146 @classmethod
130147 def setMaxBundleSize (cls , val : int ):
@@ -136,6 +153,16 @@ def setXInstructionSizeBytes(cls, val: int):
136153 """Updates size of single XInstruction"""
137154 cls .__XINSTRUCTION_SIZE_BYTES = val
138155
156+ @classmethod
157+ def setCInstructionSizeBytes (cls , val : int ):
158+ """Updates size of single CInstruction"""
159+ cls .__CINSTRUCTION_SIZE_BYTES = val
160+
161+ @classmethod
162+ def setMInstructionSizeBytes (cls , val : int ):
163+ """Updates size of single MInstruction"""
164+ cls .__MINSTRUCTION_SIZE_BYTES = val
165+
139166
140167def convertBytes2Words (bytes_in : int ) -> int :
141168 """
@@ -363,6 +390,11 @@ def XINST_QUEUE_MAX_CAPACITY_WORDS(cls):
363390 """Maximum capacity of the XINST queue in words."""
364391 return convertBytes2Words (cls .__XINST_QUEUE_MAX_CAPACITY )
365392
393+ @classproperty
394+ def XINST_QUEUE_MAX_CAPACITY_ENTRIES (cls ):
395+ """Maximum number of entries in the XINST queue."""
396+ return cls .__XINST_QUEUE_MAX_CAPACITY // Constants .XINSTRUCTION_SIZE_BYTES
397+
366398 @classproperty
367399 def CINST_QUEUE_MAX_CAPACITY (cls ):
368400 """Maximum capacity of the CINST queue in bytes."""
@@ -373,6 +405,11 @@ def CINST_QUEUE_MAX_CAPACITY_WORDS(cls):
373405 """Maximum capacity of the CINST queue in words."""
374406 return convertBytes2Words (cls .__CINST_QUEUE_MAX_CAPACITY )
375407
408+ @classproperty
409+ def CINST_QUEUE_MAX_CAPACITY_ENTRIES (cls ):
410+ """Maximum number of entries in the CINST queue."""
411+ return cls .__CINST_QUEUE_MAX_CAPACITY // Constants .CINSTRUCTION_SIZE_BYTES
412+
376413 @classproperty
377414 def MINST_QUEUE_MAX_CAPACITY (cls ):
378415 """Maximum capacity of the MINST queue in bytes."""
@@ -383,6 +420,11 @@ def MINST_QUEUE_MAX_CAPACITY_WORDS(cls):
383420 """Maximum capacity of the MINST queue in words."""
384421 return convertBytes2Words (cls .__MINST_QUEUE_MAX_CAPACITY )
385422
423+ @classproperty
424+ def MINST_QUEUE_MAX_CAPACITY_ENTRIES (cls ):
425+ """Maximum number of entries in the MINST queue."""
426+ return cls .__MINST_QUEUE_MAX_CAPACITY // Constants .MINSTRUCTION_SIZE_BYTES
427+
386428 @classproperty
387429 def STORE_BUFFER_MAX_CAPACITY (cls ):
388430 """Maximum capacity of the store buffer in bytes."""
0 commit comments