Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/analyzer/src/symbol_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,12 @@ impl SymbolTable {
}

let mut namespace = namespace.clone();

// Remove anonymous blocks
namespace
.paths
.retain(|x| x.to_string().find('@').is_none());

let path = namespace.pop().map(|x| SymbolPath::new(&[x]))?;
let context = ResolveContext::new(&namespace);
let params = self
Expand Down
31 changes: 31 additions & 0 deletions crates/analyzer/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4762,6 +4762,37 @@ fn unknown_member() {

let errors = analyze(code);
assert!(errors.is_empty());

let code = r#"
proto package foo_proto_pkg {
const WIDTH: u32;
struct foo_struct {
foo: logic<WIDTH>,
}
}
package foo_pkg::<W: u32> for foo_proto_pkg {
const WIDTH: u32 = W;
struct foo_struct {
foo: logic<WIDTH>,
}
}
interface foo_if::<PKG: foo_proto_pkg> {
var foo: PKG::foo_struct;
modport mp {
foo: input,
}
}
module foo_module::<PKG: foo_proto_pkg> {
inst foo: foo_if::<PKG>;
var _foo: logic;
always_comb {
_foo = foo.foo.foo;
}
}
"#;

let errors = analyze(code);
assert!(errors.is_empty());
}

#[test]
Expand Down