Anmol Sahoo
Anmol Sahoo

Reputation: 175

Question regarding lazy evaluation for Diplomacy (rocket-chip)?

I have been reading through the Diplomacy model for Chisel. I had a question regarding the design philosophy behind this. As I can understand, the lazy evaluation of Scala is used to register some compile time information which can be forced to evaluate during elaboration before FIRRTL generation to do meta-operations like parameter negotiation.

My question is, is this the only approach? Would it be possible to create a proxy object in Scala which registers these meta-properties and evaluates them when a particular function is called? Then this function can be called before evaluation, to do the negotiation.

The reason I am asking this is because I am incrementally learning Scala and Chisel, thus would like to understand how to build abstractions as incrementally as possible, without as basic primitives as possible.

Upvotes: 2

Views: 133

Answers (1)

Chick Markley
Chick Markley

Reputation: 4051

I doubt that Diplomacy is the only possible approach to this problem. It has evolved over time to meet the needs of an adaptable generator based approach. One of the key features is the ability to acquire information from modules as they evaluate their parameters. It's possible some proxy system might accomplish the same functionality, but there would be a risk, I think, that the meta-property code associated with the putative proxy objects would become decoupled from the paramter evaluation logic.

Upvotes: 1

Related Questions