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

VexiiRiscv branch merge #1415

Merged
merged 64 commits into from
Jun 6, 2024
Merged

VexiiRiscv branch merge #1415

merged 64 commits into from
Jun 6, 2024

Conversation

Dolu1990
Copy link
Member

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.

dataLength : Int = 0,
parity : UartParityType.E = null,
stop : UartStopType.E = null
var baudrate : Int = 0,
Copy link
Collaborator

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)

Copy link
Member Author

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

Copy link
Collaborator

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.

Copy link
Member Author

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>
@Dolu1990 Dolu1990 merged commit aa8c631 into dev Jun 6, 2024
11 checks passed
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