Assumed issue in the Lola-2 compiler
Meawhile I was able to do some cross-validation of my C++ version of the Lola compiler. I originally wanted to compile the Lola compiler on the Oberon System and translate the Lola RISC5 files to Verilog there. Unfortunately I had no luck with the Oberon System Plugin 2.5 release on Windows 10. Eventually I managed to create an executable of the original Lola-2 compiler using https://github.com/vishaps/voc . I'm aware that this is also a transpiler but at least an independent implementation. Both Lola-2 compilers - the one created with voc and also my C++ version - produce exactly the same output. Here are the links to the generated files: voc version: https://github.com/rochus-keller/Lolac/tree/master/Examples/RISC5_translated... c++ version: https://github.com/rochus-keller/Lolac/tree/master/Examples/RISC5_translated Both generated file sets show the wrong type "???" in some declarations; see e.g. RISC5Top.v lines 21 to 26. I used the source code from https://people.inf.ethz.ch/wirth/Lola/index.html It would be a little surprising if I were the first to encounter this problem. That's why I put my question into the round, who has already seen the problem and how to solve it. Does someone have a version of the Lola-2 which generates other output? Best R.
Hi R.,
Both Lola-2 compilers - the one created with voc and also my C++ version - produce exactly the same output... Both generated file sets show the wrong type "???" in some declarations; see e.g. RISC5Top.v lines 21 to 26.
Good catch! Thanks! I think at the very least, the line IF (clock IS LSB.Object) & (clock(LSB.Object).name = "clk") THEN kind := 1; clock := NIL END ; should have been removed from procedure LSC.Unit0 at the same time that this implicit clk was deprecated elsewhere, last year. I'll look into it further and report back. Apologies! I tried to compile Lolac on macos, but the tools declined due to the deprecation of x86 in favour of x64. Why is the Makefile trying to make a 32-bit binary? I tried again on a VM running Centos 7, Linux (kernel) 3.10.0, g++ (GCC) 4.8.5 20150623, and it built, but when run, e.g. $ ./Lolac RISC5Top.Lola it creates no output that I can find. What am I missing? Cheers, Paul
I commented out the whole line «IF (Clock IS LSB:Object) & … END;», and it seems to work. LSV.List RISC5Top.v now generates «always @ (posedge clk) begin…» Jörg Gesendet von Mail für Windows 10 Von: Paul Reed Gesendet: Samstag, 13. April 2019 01:43 An: ETH Oberon and related systems Betreff: Re: [Oberon] Assumed issue in the Lola-2 compiler Hi R.,
Both Lola-2 compilers - the one created with voc and also my C++ version - produce exactly the same output... Both generated file sets show the wrong type "???" in some declarations; see e.g. RISC5Top.v lines 21 to 26.
Good catch! Thanks! I think at the very least, the line IF (clock IS LSB.Object) & (clock(LSB.Object).name = "clk") THEN kind := 1; clock := NIL END ; should have been removed from procedure LSC.Unit0 at the same time that this implicit clk was deprecated elsewhere, last year. I'll look into it further and report back. Apologies! I tried to compile Lolac on macos, but the tools declined due to the deprecation of x86 in favour of x64. Why is the Makefile trying to make a 32-bit binary? I tried again on a VM running Centos 7, Linux (kernel) 3.10.0, g++ (GCC) 4.8.5 20150623, and it built, but when run, e.g. $ ./Lolac RISC5Top.Lola it creates no output that I can find. What am I missing? Cheers, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi all I successfully compiled the Lola source at https://people.inf.ethz.ch/wirth/Lola/index.html with the LinzOberon system on Windows 10. After the porting (I only had to change all string assignments to COPY()) and trying to compile SmallPrograms.Lola I detected that LSC.Mod has two bugs in CheckTypes(): Bug 1: ELSIF xtyp IS LSB.ArrayType THEN IF xtyp(LSB.ArrayType).eltyp = LSB.bitType THEN IF (ytyp IS LSB.ArrayType) & (ytyp(LSB.ArrayType).eltyp = LSB.bitType) THEN Bug 2: instead of ELSE Err(34) it should be ELSIF ytyp # LSB.bitType THEN Err(34) After these modifications SmallPrograms.Lola compile br Joerg Gesendet von Mail für Windows 10 Von: rochus.keller@bluewin.ch Gesendet: Freitag, 12. April 2019 23:32 An: oberon@lists.inf.ethz.ch Betreff: [Oberon] Assumed issue in the Lola-2 compiler Meawhile I was able to do some cross-validation of my C++ version of the Lola compiler. I originally wanted to compile the Lola compiler on the Oberon System and translate the Lola RISC5 files to Verilog there. Unfortunately I had no luck with the Oberon System Plugin 2.5 release on Windows 10. Eventually I managed to create an executable of the original Lola-2 compiler using https://github.com/vishaps/voc . I'm aware that this is also a transpiler but at least an independent implementation. Both Lola-2 compilers - the one created with voc and also my C++ version - produce exactly the same output. Here are the links to the generated files: voc version: https://github.com/rochus-keller/Lolac/tree/master/Examples/RISC5_translated... c++ version: https://github.com/rochus-keller/Lolac/tree/master/Examples/RISC5_translated Both generated file sets show the wrong type "???" in some declarations; see e.g. RISC5Top.v lines 21 to 26. I used the source code from https://people.inf.ethz.ch/wirth/Lola/index.html It would be a little surprising if I were the first to encounter this problem. That's why I put my question into the round, who has already seen the problem and how to solve it. Does someone have a version of the Lola-2 which generates other output? Best R. -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (3)
-
Jörg Straube -
Paul Reed -
rochus.keller@bluewin.ch