2 Copyright (c) 2020 Peter Hsu. All Rights Reserved. See LICENCE file for details.
7 #define sex(rd) IR(rd).l = IR(rd).l << 32 >> 32
8 #define zex(rd) IR(rd).ul = IR(rd).ul << 32 >> 32
11 extern unsigned long lrsc_set
; // globally shared location for atomic lock
16 struct reg_t reg
[64]; // Register files, IR[0-31], FR[32-63]
17 #define IR(rn) cpu->reg[rn]
18 #define FR(rn) cpu->reg[rn]
19 Addr_t pc
; // Next instruction to be executed
20 Addr_t holding_pc
; // For verification tracing
40 struct timeval start_timeval
;
44 Addr_t breakpoint
; /* entrypoint of traced function */
45 long after
; /* countdown, negative=start tracing */
46 long every
; /* but only trace once per n-1 calls */
47 long skip
; /* skip until negative, reset to every */
55 extern struct fifo_t verify
;
57 void init_core(struct core_t
* cpu
, long start_tick
, const struct timeval
* start_timeval
);
58 int run_program(struct core_t
* cpu
);
59 int outer_loop(struct core_t
* cpu
);
60 void fast_sim(struct core_t
*, long max_count
);
61 void slow_sim(struct core_t
*, long max_count
);
62 int proxy_ecall( struct core_t
* cpu
);
63 void proxy_csr( struct core_t
* cpu
, const struct insn_t
* p
, int which
);
64 void status_report(struct core_t
* cpu
, FILE*);