summaryrefslogtreecommitdiff
path: root/assembler/arbitrary_constants.py
diff options
context:
space:
mode:
Diffstat (limited to 'assembler/arbitrary_constants.py')
-rw-r--r--assembler/arbitrary_constants.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/assembler/arbitrary_constants.py b/assembler/arbitrary_constants.py
new file mode 100644
index 0000000..88c0722
--- /dev/null
+++ b/assembler/arbitrary_constants.py
@@ -0,0 +1,22 @@
+# These numbers don't change behavior much and aren't specified yet, but there being a number is required
+
+max_immediate_value_size = 64
+immediate_bit_size = math.ceil(math.log2(max_immediate_value_size))
+
+num_registers = 16
+
+# Likely won't be limited quite like this, but this still works
+max_types_per_queue = 16
+max_instructions_per_type = 16
+
+num_instructions_bit_size = math.ceil(math.log2(max_instructions_per_type))
+
+print("Bits to declare instruction count per opcode:", num_instructions_bit_size)
+
+max_parameters_per_instruction = 0
+for name in instructions:
+ if instructions[name]['params'] > max_parameters_per_instruction:
+ max_parameters_per_instruction = instructions[name]['params']
+
+max_parameters_per_instruction += 2 # conditional
+