File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,11 @@ void DifftestRef::raise_intr(uint64_t no) {
394394 }
395395}
396396
397+ void DifftestRef::update_mip (void *non_reg_interrupt_pending) {
398+ auto n = (DifftestNonRegInterruptPending *) non_reg_interrupt_pending;
399+ state->mip ->backdoor_write_with_mask (MIP_MTIP, n->platform_irp_mtip ? MIP_MTIP : 0 );
400+ }
401+
397402void DifftestRef::display () {
398403 int i;
399404 for (i = 0 ; i < 32 ; i ++) {
@@ -600,4 +605,8 @@ void difftest_set_ramsize(size_t size) {
600605 overrided_mem_size = size;
601606}
602607
608+ void difftest_non_reg_interrupt_pending (void *non_reg_interrupt_pending) {
609+ ref->update_mip (non_reg_interrupt_pending);
610+ }
611+
603612}
Original file line number Diff line number Diff line change @@ -118,6 +118,18 @@ class DifftestUarchStatus {
118118 uint64_t sc_failed = 0 ;
119119};
120120
121+ class DifftestNonRegInterruptPending {
122+ public:
123+ bool platform_irp_meip = false ;
124+ bool platform_irp_mtip = false ;
125+ bool platform_irp_msip = false ;
126+ bool platform_irp_seip = false ;
127+ bool platform_irp_stip = false ;
128+ bool platform_irp_vseip = false ;
129+ bool platform_irp_vstip = false ;
130+ bool lcofi_req = false ;
131+ };
132+
121133class DifftestRef {
122134public:
123135 DifftestRef ();
@@ -131,6 +143,7 @@ class DifftestRef {
131143 int store_commit (uint64_t *addr, uint64_t *data, uint8_t *mask);
132144 void raise_intr (uint64_t no);
133145 void display ();
146+ void update_mip (void *non_reg_interrupt_pending);
134147 void update_dynamic_config (void * config) {
135148#ifdef RISCV_ENABLE_COMMITLOG
136149 p->enable_log_commits ();
You can’t perform that action at this time.
0 commit comments