Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw-model: Set fuses via soc_ifc, change HwModel::new() semantics #142

Merged
merged 10 commits into from
Apr 6, 2023

Conversation

korran
Copy link
Collaborator

@korran korran commented Apr 5, 2023

This PR attempts to unify fuses between HwModelEmulated and HwModelVerilated, by removing all the fuse-related configuration from CaliptraRootBusArgs, and instead using the external soc_ifc bus to set them during early boot.

Also, caliptra_hw_model::create() is replaced by caliptra_hw_model::new(), which has slightly different semantics. This function is intended to be used by most test cases to set the fuses, start the boot FSM, and (optionally) upload the firmware to the mailbox. A bare-bones caliptra_hw_model::new_unbooted() function is provided for test cases that need to manipulate the external SoC->Caliptra APB bus directly during early boot in a non-standard way.

@korran korran force-pushed the soc-ifc-ext branch 6 times, most recently from 0d37b98 to 8d00d49 Compare April 5, 2023 06:33
Tweak the emulator and HwModel to expose a separate external
SoC->Caliptra bus.  Unlike the internal bus used by the Caliptra
microcontroller, this bus can be used to set fuses during early boot,
just like the SoC->Caliptra APB bus in the RTL.
This allows these functions to be used for any size array between 0 and
16 words.
This eliminates some boilerplate code.
This is necessary to make the emulator behave more like the RTL for
HwModel tests.
This will be used to represent the complete set of fuses in the run
parameters.
@korran korran force-pushed the soc-ifc-ext branch 4 times, most recently from 318404a to 48eee27 Compare April 5, 2023 07:45
@korran korran changed the title hw-model: Set fuses via soc_ifc, add HwModel::new_for_run hw-model: Set fuses via soc_ifc, change HwModel::new() semantics Apr 5, 2023
@korran korran requested a review from mhatrevi April 5, 2023 08:05
@korran korran marked this pull request as ready for review April 5, 2023 08:05
@korran korran requested a review from vsonims April 5, 2023 08:06
caliptra_hw_model::create() is replaced with a new utility function,
caliptra_hw_model::new(), which has slightly different semantics. This
function is intended to be used by most test cases to set the fuses,
start the boot FSM, and (optionally) upload the firmware to the mailbox.
A bare-bones caliptra_hw_model::new_unbooted() function is provided for
test cases that need to manipulate the external SoC->Caliptra APB bus
directly during early boot in a non-standard way.
@korran korran merged commit f238d0f into chipsalliance:main Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants