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