remove sync set output_state
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Nov 2018 10:31:26 +0000 (10:31 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Nov 2018 10:31:26 +0000 (10:31 +0000)
cpu_fetch_stage.py
cpudefs.py

index 7c699bd13cb9645d61523c7b1bfd346b3dadeca0..820591efa2ab76c723b357712ab51f14aa192c69 100644 (file)
@@ -67,7 +67,6 @@ class CPUFetchStage(Module):
         delayed_instruction_valid = Signal(reset=0)
 
         self.sync += delayed_instruction.eq(self.output_instruction)
-        self.sync += self.output_state.eq(fetch_output_state_empty)
 
         self.comb += If(delayed_instruction_valid,
                     self.output_instruction.eq(delayed_instruction)
index 9877e36254368cb663ee8c585f5fae198fa476c2..9a58cffa6feead8f7657502f94b6ccd9e78c1d2c 100644 (file)
  */
 """
 
+from migen import Constant
 fetch_action = 3
 
-fetch_action_default = 0x0
-fetch_action_fence = 0x1
-fetch_action_jump = 0x2
-fetch_action_wait = 0x3
-fetch_action_error_trap = 0x4
-fetch_action_noerror_trap = 0x5
-fetch_action_ack_trap = 0x6
+fetch_action_default = Constant(0x0, fetch_action)
+fetch_action_fence = Constant(0x1, fetch_action)
+fetch_action_jump = Constant(0x2, fetch_action)
+fetch_action_wait = Constant(0x3, fetch_action)
+fetch_action_error_trap = Constant(0x4, fetch_action)
+fetch_action_noerror_trap = Constant(0x5, fetch_action)
+fetch_action_ack_trap = Constant(0x6, fetch_action)
 
 fetch_output_state = 2
 
-fetch_output_state_empty = 0x0
-fetch_output_state_valid = 0x1
-fetch_output_state_trap = 0x2
+fetch_output_state_empty = Constant(0x0, fetch_output_state)
+fetch_output_state_valid = Constant(0x1, fetch_output_state)
+fetch_output_state_trap = Constant(0x2, fetch_output_state)
 
 decode_action = 12
 
-decode_action_trap_illegal_instruction = 0x1
-decode_action_load = 0x2
-decode_action_fence = 0x4
-decode_action_fence_i = 0x8
-decode_action_op_op_imm = 0x10
-decode_action_lui_auipc = 0x20
-decode_action_store = 0x40
-decode_action_branch = 0x80
-decode_action_jalr = 0x100
-decode_action_jal = 0x200
-decode_action_trap_ecall_ebreak = 0x400
-decode_action_csr = 0x800
+decode_action_trap_illegal_instruction = Constant(0x1, decode_action)
+decode_action_load = Constant(0x2, decode_action)
+decode_action_fence = Constant(0x4, decode_action)
+decode_action_fence_i = Constant(0x8, decode_action)
+decode_action_op_op_imm = Constant(0x10, decode_action)
+decode_action_lui_auipc = Constant(0x20, decode_action)
+decode_action_store = Constant(0x40, decode_action)
+decode_action_branch = Constant(0x80, decode_action)
+decode_action_jalr = Constant(0x100, decode_action)
+decode_action_jal = Constant(0x200, decode_action)
+decode_action_trap_ecall_ebreak = Constant(0x400, decode_action)
+decode_action_csr = Constant(0x800, decode_action)