google / cairn

Apache License 2.0
4 stars 3 forks source link

Add the pass Global Variable Replacement #8

Closed XiangyuG closed 9 months ago

XiangyuG commented 10 months ago

This PR can guarantee the successful rewrite for the test case pass1.p4

qobilidop commented 10 months ago

@XiangyuG Can you leave a comment here to document how you tested this pass? Include the commands to run, and the important outputs that demonstrate this pass works as expected.

Ideally we can set up some automated testing, but that can be left as future work.

XiangyuG commented 10 months ago

@XiangyuG Can you leave a comment here to document how you tested this pass? Include the commands to run, and the important outputs that demonstrate this pass works as expected.

Ideally we can set up some automated testing, but that can be left as future work.

Sure, this is a good suggestion. RIght now the test command is

cd tools
./build.sh
cd ..
p4c-cairn -o scratch/test_out.p4 compiler/testdata/<testfile name. e.g. pass1.p4>