[RFC][Sim] Add declarations and reads for externally controlled configuration bits#10552
[RFC][Sim] Add declarations and reads for externally controlled configuration bits#10552nanjo712 wants to merge 1 commit into
Conversation
…d configuration bits
|
These However, we should avoid introducing this technical debt into the Sim dialect. I see two better alternatives:
|
|
I think I understand the assertion-control direction better now, but I want to clarify one point. In the current FIRRTLToHW lowering, So the existing mechanism allows the macro to expand to a runtime testbench signal, e.g. Then the external runtime control would come from the simulator's assertion control state, not from an injected |
|
I think there are three separate concepts here:
For Supplement: I am not sure |
|
Hi @fzi-hielscher, I'd be interested to hear your thoughts on modeling runtime configuration within the context of Sim dialects. I would greatly appreciate seeing your perspective on this matter. |
|
Sorry for the late reply. I might be more comfortable if this was model was global variable (c.f. llhd.global_signal), not as config. Lowering them to some arc runtime function (for arcilator) or some ABI-defined macro (SV) is certainly ok. WDYT? |
|
I like your idea of providing global registers/variables for simulation that are not tied to a specific simulator mechanism. But the first thing we need to determine is when and how we want to be able to change their value. I can think of three variants:
The way I'm interpreting the operations you have described here, you have been targeting variant (1), right? But apparently the SiFive use-case for the In the case of (2), I agree with @uenoku that it would be even more useful if we had something like probes, allowing us to manipulate generic signals and not only simulation specific ones. |
I think we need a mechanism to replace some of the functionality of the SV macros in FIRRTLToHW. From my observation, STOP_COND and PRINTF_COND behave like configurations that allow external injection, and I want to introduce this abstraction into the Sim dialect.
I've implemented a preliminary approach to naming and designing this Op.