Comments (4)
Thank you for reporting this. I apologize that you encountered the error.
To determine the cause, we need more information. Are you able to provide the source code that you compiled, such as Testbench.bsv and any files that it imports?
Also, is there more to the error message? After "quoting a character value", I would expect to see a number.
from bsc.
Hi, here is the source code I tried to compile. And there is no more error message.
package MultTb;
import Mult::*;
module mkTestbench (Empty);
Mult_ifc m1 <- mkMult;
Mult_ifc m2 <- mkMult;
Reg #(int) rg_x <- mkReg (1);
Reg #(int) rg_y1 <- mkReg (1);
Reg #(int) rg_y2 <- mkReg (1);
rule gen_x;
m1.put_x (rg_x);
rg_x <= rg_x + 1; // Wertfolge
endrule
rule gen_y1;
m1.put_y (rg_y1);
rg_y1 <= rg_y1 + 2; // Wertfolge
endrule
rule gen_y2;
m2.put_y (rg_y2);
rg_y2 <= rg_y2 + 3; // Wertfolge
endrule
rule rl_connect;
let x2 <- m1.get_w ();
m2.put_x (x2);
endrule
Reg #(int) rg_j <- mkReg (0);
rule drain;
let w2 <- m2.get_w ();
$display ("Product [%0d]: %0d x %0d x %0d = %0d”,rg_j, rg_j+1, rg_j*2+1, rg_j*3+1, w2");
if (rg_j == 10) $finish ();
rg_j <= rg_j + 1;
endrule
endmodule: mkTestbench
endpackage
from bsc.
Can you use the “attach files” option to upload the file? Because I’m not sure if the text is displaying correctly. For example, I notice an extra quote (“) at the end of the $display arguments?
from bsc.
You also have not provided the source for the Mult
package which is being imported.
However, I believe the error is because you are using a unicode character in a string somewhere, such as in a $display
statement. I can reproduce the error with this example:
(* synthesize *)
module mkTest ();
rule r;
$display("ă");
$finish(0);
endrule
endmodule
This is something that we overlooked when we recently added Unicode support. We will look at it in the coming weeks, but in the meantime, characters with encodings above 255 should be avoided in strings.
The cause of the problem is here (line 128 in src/comp/Util.hs
). This is used to define the function to_quoted_string
, which is used in both CCSyntax.hs
and Verilog.hs
to print string literals in C++ and Verilog. The code currently gives an internal error if the character encoding is above 255. That should be fixed. Though off hand I don't know if the answer is for to_string
to print an encoding (like \u1234
), or to print the unicode character directly, or to not use to_string
and instead have a function that returns a byte encoding -- and possibly the C++ and Verilog contexts should use different functions, if the syntax for encoding of strings is different between the two. (Mostly I think that to_string
is trying to escape characters like \n
and \t
etc.)
The error message is expected to print the encoding number that was found, but it is not being printed because of missing parentheses in line 128 of Util.hs
, around the string concat that adds the number to the error message. Because the context is expecting a string, the expression still typechecks, so the missing parentheses isn't caught!
from bsc.
Related Issues (20)
- 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 7
- -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
- [Bluesim] Simulation executable fails with `undefined symbol: _Z21vcd_write_scope_startP9tSimStatePKc` HOT 9
- `sqrtFP` is incorrect HOT 6
- compile to verilog, convert function to function, but not to modules. HOT 1
- Preserving structure at synthesis boundaries HOT 2
- Better control of wrapper generation HOT 6
- Incremental compilation model and UX improvements
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.