-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
VexiiRiscv branch merge #1415
VexiiRiscv branch merge #1415
Conversation
…e-exp # Conflicts: # lib/src/main/scala/spinal/lib/system/tag/Bus.scala
# Conflicts: # core/src/main/scala/spinal/core/sim/package.scala
dataLength : Int = 0, | ||
parity : UartParityType.E = null, | ||
stop : UartStopType.E = null | ||
var baudrate : Int = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these really be vars?
The user can never make those vals again so that they stay consistent, but if you want/need to be able to change them you can always have a var config: UartCtrlInitConfig
and reassign to that from config.copy(...)
(as with pretty much all other configs in lib)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, i'm more and more "pissed" by the all functional paradigm / val ^^
config.copy is kinda too dogmatic i think. While mutability is just easy ?
Often it work just great to have a default config and mutate it a bit.
(as with pretty much all other configs in lib)
Maybe that is wrong aswell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure - If you pass one config object into multiple constructors (forgetting to copy them) and one ends up changing it, it's suddenly modified for all places. Kind of the curse of Java reference semantics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure - If you pass one config object into multiple constructors (forgetting to copy them) and one ends up changing it, it's suddenly modified for all places. Kind of the curse of Java reference semantics.
Yes, right.
On the other hand, imutability prevent "natural" patterns as :
val uart = new TilelinkUartFiber()
uart.config.initConfig.baudrate = 9600
Forcing you to get everything ahead of time through parameters, preventing preset default values.
In other words, imutability feel a bit like (in another context) "everything private in class, use only getters/setters"
Co-authored-by: Andreas Wallner <A.Wallner@innovative-solutions.at>
Lot of little fixes / improvments.
The main change is related to the fiber framework to provide a better error reporting.
Can be merged if it passes the regressions i would say.