Skip to content
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

panic by if_reset with explicit clock and no reset #1112

Closed
clkbug opened this issue Dec 1, 2024 · 0 comments · Fixed by #1116
Closed

panic by if_reset with explicit clock and no reset #1112

clkbug opened this issue Dec 1, 2024 · 0 comments · Fixed by #1116
Labels
bug Something isn't working

Comments

@clkbug
Copy link

clkbug commented Dec 1, 2024

This code makes the veryl compiler panic.

module ModuleA #() (
    i_clk: input clock,
    i_rst: input reset,
) {
    always_ff (i_clk) {
        if_reset {}
    }
}

The backtrace is here:

thread 'main' panicked at crates/emitter/src/emitter.rs:1927:54:
called Option::unwrap() on a None value
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::unwrap_failed
4: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::if_reset_statement
5: veryl_emitter::emitter::Emitter::emit_statement_block
6: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::always_ff_declaration
7: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::module_group
8: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::module_declaration
9: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::description_group
10: <veryl_emitter::emitter::Emitter as veryl_parser::veryl_walker::VerylWalker>::veryl
11: veryl_emitter::emitter::Emitter::emit
12: veryl::cmd_build::CmdBuild::exec
13: veryl::main

I have confirmed this with Veryl version 0.13.3 and the online playground.

@dalance dalance added the bug Something isn't working label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants