[Multitop, test] chip_sw_power_virus
Open
Nobody has claimed this yet.
Component:ChipLevelTest
IP:
Multitop:Autogen
Priority:P2
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
- Tests should not depend on earlgrey constants. Try removing #include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" and see what doesn't compile.
- Replace any dif__init with dif__init_from_dt to avoid TOP_EARLGREY__BASE_ADDR.
- Add //hw/top:dt to deps to get all device table libraries.
- Use bazel build //hw/top:dt_api_hdr and bazel build //hw/top:dt__hdr to see the autogenerated DT headers. The _src suffix shows the C files.
- Grep for kClockFreq.*. These are top-specific but don't come from a top_earlgrey header. Replace with dt_clock_frequency(...).
- For ISRs: replace peripheral = with dt_plic_id_to_instance_id and compare to the DT instance using dt__instance_id(dt__t).
- Again for ISRs, convert the plic IRQ ID to a block-specific ID with dt__irq_from_plic_id and switch on that.
The test chip_sw_power_virus should run and pass for Ealrgrey and should build for Darjeeling.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the chip_sw_power_virus test and its top_earlgrey header use. Remove the top-specific dependencies, use the listed device-table and interrupt helpers, and run the suggested DT header builds. Done means the test runs and passes for Earlgrey and builds for Darjeeling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100