-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add section for idioms #131
Comments
Yes, such section would be usefull, showing all kind of funny / creative thing |
Nice Work! |
Maybe we can do a call to discuss about patterns ? |
I was thinking that each pattern would be introduced by a PR into the which we could discuss but a call might be good too. |
sure. |
Note for when I will have created this section: Function-like components: a companion object with an object MyComponent {
def apply(i: MyEnum.C): Bits = {
val myComponent = new MyComponent
myComponent.io.i := i
myComponent.io.o
}
} |
Once idioms are defined we can provide snippets (for instance providing them in the template) for IDEs. For instance: "Doing flag": {
"scope": "scala",
"prefix": "doing",
"body": ["val ${2:${1}ing} = False", "def $1(): Unit = $2 := True", ""]
} We can also provide such snippets for With this example snippet in VSCodium with 8 keystrokes:
I get: val runing = False
def run(): Unit = runing := True (It can require more than the 2 keystrokes |
Spinal enables representing the code in a way which is not possible in RTL.
This section would show idioms which are useful in Spinal. For each idiom, it would explain it, how to use it, when and why it is good to use it, and maybe how it works.
Example of idiom:
I find it useful in
fsm.State.whenActive
to express the output logic.The text was updated successfully, but these errors were encountered: