Comments (3)
I don't see a reason why that shouldn't be accepted. Thank you for reporting the issue!
As you saw, one workaround is to replace the vector selection with a variable name. Another is to wrap the selection with asReg
or asIfc
.
I suspect that fixing this might be as simple as adding the following clause to the flags used for parsing the init and increment parts of the for-loop control triple:
allowSubscriptAssign = (ctxt == ISCSequence)
This is in the function pImperativeForControl
(here) which parses the triple. It's used in pImperativeFor
, defined above it, that parses the for loop.
The question is whether this would allow something incorrect to parse -- probably not? Note that it would also allow assignment to a range, not just a single index:
Reg#(Bit#(32)) baz <- mkReg('1);
...
for(baz[7:0] <= 0; baz[7:0] < 10; baz[7:0] <= baz[7:0] + 1) action
$display("baz[7:0] is %h", baz[7:0]);
$display("baz is %h", baz);
endaction
from bsc.
Having a look at the other fields in the type ImperativeFlags
, I see that we might also want to assert allowFieldAssign
, to allow code like this:
for(rg_s.f1 <= 0; rg_s.f1 < 10; rg_s.f1 <= rg_s.f1 + 1) action
$display("rg_s.f1 is %h", rg_s.f1);
endaction
from bsc.
I've merged a PR that fixes this and adds test cases. Thanks again!
from bsc.
Related Issues (20)
- Improve the mechanism for testing Bluespec Inc bug 1490 HOT 3
- `-dparsed` output produces invalid register updates with BSV HOT 2
- `-dparsed` produces invalid BSV module function that takes another module as an argument HOT 2
- Missing `Ord Bool` instance HOT 7
- Static check of file descriptor argument to tasks like $fgetc HOT 3
- Testsuite reports an error getting BSC version HOT 2
- Internal Compiler Error when quoting a character value. HOT 4
- Bluesim's symbol-probing interface has wrong values for FIFO
- Unresolved numeric contexts that should be resolvable HOT 6
- Verilog import fails in macro substitution HOT 2
- Unexpected syntax error HOT 1
- expandPorts.tcl has hardcoded paths which do not exist. HOT 1
- Unexpected behavior in Stmt sequence when using par HOT 2
- Bluesim divide-by-zero behavior is inconsistent on arm64 HOT 2
- Type synonyms with phantom parameters can lead to strange behaviors (E.g., compiler hang) HOT 4
- doc example for mkUniqueWrapper2 HOT 6
- -remove-unused-modules flag doesn't work with mkProbe module provided in std library HOT 2
- Failures with compilation on raspberry-pi 5 HOT 4
- GCC 14 emits extra warnings HOT 1
- Github's macos-11 runner is going away HOT 1
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 bsc.