google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.22k stars 181 forks source link

IR file created by FunctionBuilder won't parse in opt_main #404

Open spurserh opened 3 years ago

spurserh commented 3 years ago

blaze-bin/third_party/xls/tools/opt_main /tmp/test.ir F0421 17:11:08.143368 1575568 opt_main.cc:88] Check failed: ::absl::OkStatus() == (xls::RealMain(positional_arguments[0])) (OK vs. INVALID_ARGUMENT: Expected token of type "ident" @ 3:37, but found: Token("keyword", value="next") @ 3:37; @ /tmp/test.ir)

spurserh commented 3 years ago

Seems changing "next" to "nextc" allows this opt_main to succeed.

cdleary commented 3 years ago

Good find, we should probably have a test that round trips this trying to use an identifier for each of the IR keywords:

https://github.com/google/xls/blob/f47a3a07863c47693bd4279969e5ca60173d2eb2/xls/ir/ir_scanner.h#L65