Comments (2)
Vectors can be indexed by any Integral
type: http://hackage.haskell.org/package/clash-prelude-0.6.0.1/docs/CLaSH-Sized-Vector.html#v:-33--33-
So you can just write:
(1:>2:>3:>4:>5:>Nil) !! (2 :: Unsigned 12)
Note that you get a run-time error when you index out of bounds:
(1:>2:>3:>4:>5:>Nil) !! (14 :: Unsigned 12)
*** Exception: (!!): Index 14 is out of bounds [0..4]
from clash-compiler.
Thanks for explanation. It was difficult to find in docs.
from clash-compiler.
Related Issues (20)
- Upstreaming `clash-port-name`? HOT 1
- Warn for insufficient `OPAQUE` annotations
- `__VOID_TDECL_NOOP__` is not correctly matched HOT 2
- Set names for ILAs and VIOs by default HOT 16
- `unknown RTS option: -xm20000000` HOT 6
- `vioProbe` does not handle `XException` values gracefully
- `vioProbe` does not handle zero-width probes gracefully
- Add ability to use a different ghc version other than the ghc build clash HOT 2
- Getting Started Update HOT 2
- Error reporting on source files got worse in #2663
- caseFlat doesn't work with newer GHCs
- `Build and run limited tests (windows, 9.6)` extremely slow HOT 14
- Upload `clash-lib`, `clash-ghc`, `clash-prelude-hedgehog` to Stackage (both nightly and lts) HOT 8
- Synthesis fails for newtypes of types with multiple fields.
- Clash fails to account for `.` in names HOT 1
- `Natural` is not exported from `clash-prelude-1.9.0`'s `Clash.Prelude` GHC 9.0.2 (and lower?) HOT 3
- Create stable version of I2C core
- Pragma changes don't invalidate clash cache
- "Setting up GHC" slowdown when going from GHC 9.0 to 9.4 HOT 9
- Empty blackbox context for `imap_go`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clash-compiler.