Bug 738

Summary: ISACaller modifies initial_sprs of test data
Product: Libre-SOC's first SoC Reporter: klehman9
Component: Source CodeAssignee: klehman9
Status: CONFIRMED ---    
Severity: enhancement CC: libre-soc-bugs, lkcl
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Linux   
NLnet milestone: --- total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0 parent task for budget allocation:
child tasks for budget allocation: The table of payments (in EUR) for this task; TOML format:
Bug Depends on: 686    
Bug Blocks:    

Description klehman9 2021-11-04 13:54:04 GMT
While working on qemu test_runner, an interesting yet frustrating problem surfaced (and known earlier because hdl needs to be ran first before IsaCaller).  IsaCaller modifies the initial_sprs of test data which throws subsequent test runners off.

Apparently, copy isn't enough, but a deepcopy fixes the issue. One would think a copy would suffice enough since it is basically just a dict, but apparently not. 

https://git.libre-soc.org/?p=openpower-isa.git;a=commit;h=8973523be79e8b063cf87e266791c36f79c42a12
Comment 1 Luke Kenneth Casson Leighton 2021-11-04 14:40:43 GMT
(In reply to klehman9 from comment #0)

> Apparently, copy isn't enough, but a deepcopy fixes the issue. One would
> think a copy would suffice enough since it is basically just a dict, but
> apparently not. 
> 
> https://git.libre-soc.org/?p=openpower-isa.git;a=commit;
> h=8973523be79e8b063cf87e266791c36f79c42a12

yes that makes sense, copy only hits "shallow" levels, deepcopy
actually copies the objects themselves pointed to *by* the keys
(the actual values).