xls icon indicating copy to clipboard operation
xls copied to clipboard

Short-circuit for side-effecting (IO) ops

Open spurserh opened this issue 3 years ago • 1 comments

To add:

TEST_F(TranslatorTest, IOShortCircuitAnd) { const std::string content = R"( #include "/xls_builtin.h" #pragma hls_top void my_package(__xls_channel& in, __xls_channel& out) { const int zero = 0; int v = 100; v = zero && in.read(); out.write(1 + v); })";

IOTest(content, /inputs=/{}, /outputs=/{IOOpTest("out", 101, true)}); }

spurserh avatar Mar 17 '22 21:03 spurserh

This may actually be a bug when it comes to assignments in short-circuit expressions.

spurserh avatar Mar 17 '22 21:03 spurserh