add cpudefs.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 22 Nov 2018 02:02:56 +0000 (02:02 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 22 Nov 2018 02:02:56 +0000 (02:02 +0000)
cpudefs.py [new file with mode: 0644]

diff --git a/cpudefs.py b/cpudefs.py
new file mode 100644 (file)
index 0000000..9877e36
--- /dev/null
@@ -0,0 +1,56 @@
+"""
+/*
+ * Copyright 2018 Jacob Lifshay
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+"""
+
+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_output_state = 2
+
+fetch_output_state_empty = 0x0
+fetch_output_state_valid = 0x1
+fetch_output_state_trap = 0x2
+
+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
+