Hi!
There are a lot of flat_hash_map::at calls in the code base which makes for a lot of possibilities here -- do you get a back trace in the output?
There's also the "whole program" verbose logging level you can set via --v=1 or similar (make sure you also have --alsologtostderr so it prints to the console).
You can also use this facility to do more printf-style debugging to figure out where the crash originates from. Dumping the IR text before codegen and checking all the IR nodes are present and accounted for in your .pbtxt would be a good soundness check.
Additionally you could `bazel build -c dbg //xls/tools:codegen_main` and then run under gdb to see where the crash occurs in context with `gdb --args
./bazel-bin/xls/tools/codegen_main test_design.opt.ir --generator=pipeline --delay_model="unit" --module_name=xls_test --top=test_function --pipeline_stages=4 --output_schedule_ir_path=sched.pbtxt --input_valid_signal="load" --output_valid_signal="done" --output_verilog_path=test.v` (use "up" to go up frames and "list" to do a code listing).
Hope these general debugging techniques are useful, let me know if you were looking for something more specific or have more questions. I would say in general there's a lot of places you can dump the IR (i.e. post scheduling) and inspect what you might be referring to that doesn't exist in the map you're supplying, there may be some way to validate your supplied pbtxt's contents against the graph in a pre-pass to make sure everything is there that you expect to be there.
Cheers,
- Chris Leary