File tree Expand file tree Collapse file tree 4 files changed +22
-19
lines changed
Expand file tree Collapse file tree 4 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,18 @@ typedef struct {
1515} CPU_state ;
1616
1717void init_cpu ();
18- void cpu_exec ();
19- void exec_once ();
20- void exec_single_inst (uint32_t inst );
2118void halt_trap (uint64_t pc , uint64_t code );
2219
20+ // ------------ ISS SIM ------------
21+ void iss_cpu_exec ();
22+ void iss_exec_once ();
23+
24+ // --------- Multi-cycle SIM ---------
25+ void mc_cpu_exec ();
26+ void mc_exec_once ();
27+
28+ // ---------- Pipeline SIM -----------
29+ void pl_cpu_exec ();
30+ void pl_exec_once ();
31+
2332#endif
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ void init_cpu(){
1919 memset (cpu .csr , 0 , sizeof (cpu .csr ));
2020}
2121
22- void exec_once () {
22+ void iss_exec_once () {
2323 Decode s ;
2424 s .pc = cpu .pc ;
2525 s .inst = inst_fetch (s .pc );
@@ -34,15 +34,9 @@ void exec_once(){
3434 cpu .pc = s .dnpc ;
3535}
3636
37- void exec_single_inst (uint32_t inst ) {
38- Decode s ;
39- s .inst = inst ;
40- decode_exec (& s );
41- }
42-
43- void cpu_exec (){
44- while (running ){
45- exec_once ();
37+ void iss_cpu_exec () {
38+ while (running ) {
39+ iss_exec_once ();
4640 }
4741}
4842
Original file line number Diff line number Diff line change 22#include <memory.h>
33#include <common.h>
44#include <dbg.h>
5- #include <decode .h>
5+ #include <isa_decode .h>
66#include <disasm.h>
77#include "ftrace.h"
88
@@ -27,7 +27,7 @@ static void cmd_help() {
2727}
2828
2929static void cmd_continue () {
30- cpu_exec ();
30+ iss_cpu_exec ();
3131}
3232
3333static void cmd_quit () {
@@ -61,7 +61,7 @@ static void cmd_step(int steps) {
6161 }
6262
6363 // Execute the instruction
64- exec_once ();
64+ iss_exec_once ();
6565 }
6666}
6767
Original file line number Diff line number Diff line change @@ -66,16 +66,16 @@ int run_iss_model(int argc, char *argv[]) {
6666 debug_loop ();
6767 }
6868 else if (argc > 2 && strcmp (argv [2 ], "--batch" ) == 0 ) {
69- cpu_exec ();
69+ iss_cpu_exec ();
7070 }
7171 else if (argc > 2 && strcmp (argv [2 ], "--itrace" ) == 0 ) {
7272 itrace_enabled = 1 ;
7373 init_llvm_disassembler ();
74- cpu_exec ();
74+ iss_cpu_exec ();
7575 }
7676 else if (argc > 2 && strcmp (argv [2 ], "--ftrace" ) == 0 ) {
7777 ftrace_enabled = 1 ;
78- cpu_exec ();
78+ iss_cpu_exec ();
7979 }
8080 else {
8181 printf ("%s" , help_string );
You can’t perform that action at this time.
0 commit comments