Bug 738 - ISACaller modifies initial_sprs of test data
Summary: ISACaller modifies initial_sprs of test data
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: klehman9
URL:
Depends on: 686
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-04 13:54 GMT by klehman9
Modified: 2021-11-04 14:40 GMT (History)
2 users (show)

See Also:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).