Comments (7)
I'd recommend you extend below class and add constraint to avoid using opcode of B instructions.
https://github.com/google/riscv-dv/blob/master/src/riscv_illegal_instr.sv
from riscv-dv.
I just added
instr_bin[11:7] != 2; // do not generate target SP
to
instr_bit_assignment_c constraint
from riscv-dv.
I think it's better to make sure it's actually generating an illegal instruction. Otherwise, it could generate a valid instruction without proper constraint, which may do something crazy and break the program execution. For example, you could potentially generate load/store instruction without proper address, or branch/jump instruction which could lead to a dead loop.
For the sp constraint, depending on the instruction format, you might need to constraint different bit position, which may make this solution more complicated to implement.
from riscv-dv.
from riscv-dv.
It's not always true for the compressed instructions. Besides, bit [11:7] could be use for other purposes if there's no rd for the instruction. This constraint ends up constrains something else which could pose a hole in the randomization.
from riscv-dv.
from riscv-dv.
I think these are just two different ways to implement it. Either have a full legal binary encoding table and generate something not belongs to this table, or directly constraint the binary to target the illegal encoding. I will consider to refactor this class a bit to make it more readable.
I am closing this issue for now as I believe the original issue is solved. Thanks for reporting.
from riscv-dv.
Related Issues (20)
- use pyflow error: ModuleNotFoundError: No module named 'ucis.ucdb' HOT 1
- riscv_csr_test fails at generation
- RVC Instruction gpr coverage collection omissions for CR/CI/CSS formate
- no_load_store switching option
- Test generation failed for riscv_amo_test
- how to generate compressed instructions regression test HOT 3
- pyflow callstack_gen randomize fail HOT 1
- [pygen] riscv_rand_instr_test run failed
- mmode_exception_handler is not considering the instruction misaligned, load address misaligned, store/amo address misaligned
- for debug mode, how to modify link.ld to match debug rom enter addr HOT 1
- for debug mode, how to modify link.ld to match debug rom enter addr
- for debug mode, how to modify link.ld to match debug rom enter addr
- for debug mode, how to modify link.ld to match debug rom enter addr
- Instruction Address Misalign Exception
- use ovpsim .Why is there no verbose log instruction HOT 5
- spike
- The spike simulation gets stuck in an endless loop HOT 2
- rv64gc failing spike due to exception trap_store_address_misaligned HOT 2
- riscv-dv breaks with riscv64-unknown-elf-gcc version tags 2023.04.18 and up HOT 5
- spike error:free(): invalid pointer: 0xxxxxxx
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 riscv-dv.