ucb-bar / midas

FPGA-Accelerated Simulation Framework Automatically Transforming Arbitrary RTL
Other
97 stars 15 forks source link

Issue with subclasses in widget matching #48

Closed zhemao closed 5 years ago

zhemao commented 7 years ago

We recently made changes to IceNet/SimpleNIC that changed the NICIO to be a subclass of SerialIO instead of StreamIO. Unfortunately, this caused midas widget mapping to break, because the SerialWidget was matching on SerialIO and all its subclasses, so it mistakenly matched the NICIO with the SerialWidget instead of the SimpleNICWidget. The solution was to change SimSerialIO's matchType function to explicitly return false for NICIO. I'm not sure how exactly this issue could be avoided in the future.

donggyukim commented 7 years ago

Seems like it's fundamentally impossible to differentiate two types having a common super type. I think in this specific case, the solution should be to define a subclass of SerialIO for SerialAdapter.

davidbiancolin commented 5 years ago

Resolved with new system.