Project Oberon running from LPDDR memory on Pipistrello
FYI, I have worked the last week with Jörg Straube on getting Project Oberon running from DRAM on the Pipistrello board and I just checked in the code on github: See https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr It's using a 128KB cache organized as a 2-way 256-set cache with 256 byte cache lines. The interface between the cache and the memory controller is 128 bits wide @100 MHz, and the memory controller itself has 800 MB/s peak memory bandwidth. On power-up the lower 128KB of the 1MB address space is covered by the cache. The main code for the cache is a simple state machine using about 150 lines of code with 4 states. The cache actually covers the lower 8MB address space so in theory we could have an 8MB Oberon system, but due to a bug somewhere in the Oberon code it crashes after about 1.25 sec with a trap (C2H on the LEDs) with more than 1MB of memory. The solution is to have the non-io address space aliased to the first 1MB. It seems like there are memory access cycles above 1MB that needs to actually affect the memory at the first 1MB. I did discover this way back when I did the 2MB version of Pepino and had the tie address bit 20 to 0 for it to boot (i.e. alias the second MB to the first MB) but never got around to pinpoint the problem. The same problem popped up again and I was able to trace it down. Video memory is in dual-port BRAM and can be relocated by writing to a new register. At power-up the video is a the normal spot (0E7F00H) but can be moved up above the 8MB boundary to have a continuous 8MB memory section for program and data by simply writing to a register with the new video base address. Cheers, Magnus
I should clarify: On power-up the cache is targeting the lower 128KB of the 1MB address space. Magnus On 5/10/2020 6:12 PM, Magnus Karlsson wrote:
FYI, I have worked the last week with Jörg Straube on getting Project Oberon running from DRAM on the Pipistrello board and I just checked in the code on github: See https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr
It's using a 128KB cache organized as a 2-way 256-set cache with 256 byte cache lines. The interface between the cache and the memory controller is 128 bits wide @100 MHz, and the memory controller itself has 800 MB/s peak memory bandwidth. On power-up the lower 128KB of the 1MB address space is covered by the cache. The main code for the cache is a simple state machine using about 150 lines of code with 4 states.
The cache actually covers the lower 8MB address space so in theory we could have an 8MB Oberon system, but due to a bug somewhere in the Oberon code it crashes after about 1.25 sec with a trap (C2H on the LEDs) with more than 1MB of memory. The solution is to have the non-io address space aliased to the first 1MB. It seems like there are memory access cycles above 1MB that needs to actually affect the memory at the first 1MB. I did discover this way back when I did the 2MB version of Pepino and had the tie address bit 20 to 0 for it to boot (i.e. alias the second MB to the first MB) but never got around to pinpoint the problem. The same problem popped up again and I was able to trace it down.
Video memory is in dual-port BRAM and can be relocated by writing to a new register. At power-up the video is a the normal spot (0E7F00H) but can be moved up above the 8MB boundary to have a continuous 8MB memory section for program and data by simply writing to a register with the new video base address.
Cheers, Magnus -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I try to fix the bug in the Oberon environment. Jörg Am 11.05.20, 03:23 schrieb "Oberon im Auftrag von Magnus Karlsson" <oberon-bounces@lists.inf.ethz.ch im Auftrag von magnus@saanlima.com>: I should clarify: On power-up the cache is targeting the lower 128KB of the 1MB address space. Magnus On 5/10/2020 6:12 PM, Magnus Karlsson wrote: > FYI, I have worked the last week with Jörg Straube on getting Project > Oberon running from DRAM on the Pipistrello board and I just checked > in the code on github: > See > https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr > > It's using a 128KB cache organized as a 2-way 256-set cache with 256 > byte cache lines. The interface between the cache and the memory > controller is 128 bits wide @100 MHz, and the memory controller itself > has 800 MB/s peak memory bandwidth. > On power-up the lower 128KB of the 1MB address space is covered by the > cache. The main code for the cache is a simple state machine using > about 150 lines of code with 4 states. > > The cache actually covers the lower 8MB address space so in theory we > could have an 8MB Oberon system, but due to a bug somewhere in the > Oberon code it crashes after about 1.25 sec with a trap (C2H on the > LEDs) with more than 1MB of memory. The solution is to have the > non-io address space aliased to the first 1MB. It seems like there > are memory access cycles above 1MB that needs to actually affect the > memory at the first 1MB. I did discover this way back when I did the > 2MB version of Pepino and had the tie address bit 20 to 0 for it to > boot (i.e. alias the second MB to the first MB) but never got around > to pinpoint the problem. The same problem popped up again and I was > able to trace it down. > > Video memory is in dual-port BRAM and can be relocated by writing to a > new register. At power-up the video is a the normal spot (0E7F00H) > but can be moved up above the 8MB boundary to have a continuous 8MB > memory section for program and data by simply writing to a register > with the new video base address. > > Cheers, > Magnus > -- > Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems > https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Magnus and Joerg: this is great news! Thank you! This is important to me because I am trying to decide how my ideal Oberon board will look like. I want to design such a board. So now I would like to use a memory hierarchy on the board. The closest to the CPU there will be the "tightly coupled memory" like Nios-II is using. (Described in the P.Chu's book on Nios-II SoPC.) This is purely firmware implemented in BRAM. It does not affect the HW design. Then I would like to use ZBT memory for the fast portion of the software. And then DRAM for everything else. Only the DRAM needs to be cached because ZBT is actually faster than the CPU can handle. Your achievement is telling me that this is a feasible design. I was more afraid of the firmware than hardware because I know how to design the boards more easily than write firmware. So now I know there will be firmware to be adopted to such a board. This is great! Thank you! Wojtek ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Magnus Karlsson [magnus@saanlima.com] Sent: Sunday, May 10, 2020 9:22 PM To: oberon@lists.inf.ethz.ch Subject: Re: [Oberon] Project Oberon running from LPDDR memory on Pipistrello I should clarify: On power-up the cache is targeting the lower 128KB of the 1MB address space. Magnus On 5/10/2020 6:12 PM, Magnus Karlsson wrote:
FYI, I have worked the last week with Jörg Straube on getting Project Oberon running from DRAM on the Pipistrello board and I just checked in the code on github: See https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Saanlima_Pipistrello_tree_master_Projects_Oberon-5Flpddr&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=ElbN9RwmzLSJdX9SqSDoNfNi-tYpwS7fAFa2lF9zcsw&e=
It's using a 128KB cache organized as a 2-way 256-set cache with 256 byte cache lines. The interface between the cache and the memory controller is 128 bits wide @100 MHz, and the memory controller itself has 800 MB/s peak memory bandwidth. On power-up the lower 128KB of the 1MB address space is covered by the cache. The main code for the cache is a simple state machine using about 150 lines of code with 4 states.
The cache actually covers the lower 8MB address space so in theory we could have an 8MB Oberon system, but due to a bug somewhere in the Oberon code it crashes after about 1.25 sec with a trap (C2H on the LEDs) with more than 1MB of memory. The solution is to have the non-io address space aliased to the first 1MB. It seems like there are memory access cycles above 1MB that needs to actually affect the memory at the first 1MB. I did discover this way back when I did the 2MB version of Pepino and had the tie address bit 20 to 0 for it to boot (i.e. alias the second MB to the first MB) but never got around to pinpoint the problem. The same problem popped up again and I was able to trace it down.
Video memory is in dual-port BRAM and can be relocated by writing to a new register. At power-up the video is a the normal spot (0E7F00H) but can be moved up above the 8MB boundary to have a continuous 8MB memory section for program and data by simply writing to a register with the new video base address.
Cheers, Magnus -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=btdXkfnQU3BoNg-OsdQqh3co_uu3UBiBKbrzI2R6kWM&e=
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=btdXkfnQU3BoNg-OsdQqh3co_uu3UBiBKbrzI2R6kWM&e=
Wojtek Currently, the design does not offer a multistage hierarchy of several types of Memory. It’s basically one L1 cache in FPGA BRAM between the RISC-5 and the LPDDR SDRAM. If you design another board it will be your task to organize someone to write the firmware for your L2, L3 caches. br Jörg Gesendet von Mail für Windows 10 Von: Skulski, Wojciech Gesendet: Montag, 11. Mai 2020 04:43 An: ETH Oberon and related systems Betreff: Re: [Oberon] Project Oberon running from LPDDR memory on Pipistrello Magnus and Joerg: this is great news! Thank you! This is important to me because I am trying to decide how my ideal Oberon board will look like. I want to design such a board. So now I would like to use a memory hierarchy on the board. The closest to the CPU there will be the "tightly coupled memory" like Nios-II is using. (Described in the P.Chu's book on Nios-II SoPC.) This is purely firmware implemented in BRAM. It does not affect the HW design. Then I would like to use ZBT memory for the fast portion of the software. And then DRAM for everything else. Only the DRAM needs to be cached because ZBT is actually faster than the CPU can handle. Your achievement is telling me that this is a feasible design. I was more afraid of the firmware than hardware because I know how to design the boards more easily than write firmware. So now I know there will be firmware to be adopted to such a board. This is great! Thank you! Wojtek ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Magnus Karlsson [magnus@saanlima.com] Sent: Sunday, May 10, 2020 9:22 PM To: oberon@lists.inf.ethz.ch Subject: Re: [Oberon] Project Oberon running from LPDDR memory on Pipistrello I should clarify: On power-up the cache is targeting the lower 128KB of the 1MB address space. Magnus On 5/10/2020 6:12 PM, Magnus Karlsson wrote:
FYI, I have worked the last week with Jörg Straube on getting Project Oberon running from DRAM on the Pipistrello board and I just checked in the code on github: See https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Saanlima_Pipistrello_tree_master_Projects_Oberon-5Flpddr&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=ElbN9RwmzLSJdX9SqSDoNfNi-tYpwS7fAFa2lF9zcsw&e=
It's using a 128KB cache organized as a 2-way 256-set cache with 256 byte cache lines. The interface between the cache and the memory controller is 128 bits wide @100 MHz, and the memory controller itself has 800 MB/s peak memory bandwidth. On power-up the lower 128KB of the 1MB address space is covered by the cache. The main code for the cache is a simple state machine using about 150 lines of code with 4 states.
The cache actually covers the lower 8MB address space so in theory we could have an 8MB Oberon system, but due to a bug somewhere in the Oberon code it crashes after about 1.25 sec with a trap (C2H on the LEDs) with more than 1MB of memory. The solution is to have the non-io address space aliased to the first 1MB. It seems like there are memory access cycles above 1MB that needs to actually affect the memory at the first 1MB. I did discover this way back when I did the 2MB version of Pepino and had the tie address bit 20 to 0 for it to boot (i.e. alias the second MB to the first MB) but never got around to pinpoint the problem. The same problem popped up again and I was able to trace it down.
Video memory is in dual-port BRAM and can be relocated by writing to a new register. At power-up the video is a the normal spot (0E7F00H) but can be moved up above the 8MB boundary to have a continuous 8MB memory section for program and data by simply writing to a register with the new video base address.
Cheers, Magnus -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=btdXkfnQU3BoNg-OsdQqh3co_uu3UBiBKbrzI2R6kWM&e=
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=pQaHutcKTL4eMMurPT09ydwVh7yL-eyIdjlQoDySq0M&s=btdXkfnQU3BoNg-OsdQqh3co_uu3UBiBKbrzI2R6kWM&e= -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Magnus Don’t know if this is the culprit: There was this line in the RISC5.v you used: assign adr = stallL ? B[23:0] + {4'b0, off} : {pcmux, 2'b00}; For backward jumps this would be better assign adr = stallL ? B[23:0] + {{4{off[19]}}, off} : {pcmux, 2'b00}; I’m in the process to verify and will include the newest enhancements and bug fixes in the Verilog files. (rounding error in floating points, new shifter and registers…) and compiler. br Jörg Gesendet von Mail für Windows 10 Von: Magnus Karlsson Gesendet: Montag, 11. Mai 2020 03:23 An: oberon@lists.inf.ethz.ch Betreff: Re: [Oberon] Project Oberon running from LPDDR memory on Pipistrello I should clarify: On power-up the cache is targeting the lower 128KB of the 1MB address space. Magnus On 5/10/2020 6:12 PM, Magnus Karlsson wrote:
FYI, I have worked the last week with Jörg Straube on getting Project Oberon running from DRAM on the Pipistrello board and I just checked in the code on github: See https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr
It's using a 128KB cache organized as a 2-way 256-set cache with 256 byte cache lines. The interface between the cache and the memory controller is 128 bits wide @100 MHz, and the memory controller itself has 800 MB/s peak memory bandwidth. On power-up the lower 128KB of the 1MB address space is covered by the cache. The main code for the cache is a simple state machine using about 150 lines of code with 4 states.
The cache actually covers the lower 8MB address space so in theory we could have an 8MB Oberon system, but due to a bug somewhere in the Oberon code it crashes after about 1.25 sec with a trap (C2H on the LEDs) with more than 1MB of memory. The solution is to have the non-io address space aliased to the first 1MB. It seems like there are memory access cycles above 1MB that needs to actually affect the memory at the first 1MB. I did discover this way back when I did the 2MB version of Pepino and had the tie address bit 20 to 0 for it to boot (i.e. alias the second MB to the first MB) but never got around to pinpoint the problem. The same problem popped up again and I was able to trace it down.
Video memory is in dual-port BRAM and can be relocated by writing to a new register. At power-up the video is a the normal spot (0E7F00H) but can be moved up above the 8MB boundary to have a continuous 8MB memory section for program and data by simply writing to a register with the new video base address.
Cheers, Magnus -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Joerg, Magnus, Surely that's to do with data access not jumps? But anyway, I believe updating the Verilog will indeed fix the 2MB problem, it did for me. I think the bug you found was to do with type descriptor access off a pointer, which was fixed a while back. Apologies for this! Hope that helps - and thanks for your efforts! Paul On 2020-05-11 09:31, Jörg Straube wrote:
Magnus
Don’t know if this is the culprit:
There was this line in the RISC5.v you used:
assign adr = stallL ? B[23:0] + {4'b0, off} : {pcmux, 2'b00};
For backward jumps this would be better
assign adr = stallL ? B[23:0] + {{4{off[19]}}, off} : {pcmux, 2'b00};
I’m in the process to verify and will include the newest enhancements and bug fixes in the Verilog files. (rounding error in floating points, new shifter and registers…) and compiler.
br
Jörg
Gesendet von Mail [1] für Windows 10
VON: Magnus Karlsson GESENDET: Montag, 11. Mai 2020 03:23 AN: oberon@lists.inf.ethz.ch BETREFF: Re: [Oberon] Project Oberon running from LPDDR memory on Pipistrello
I should clarify:
On power-up the cache is targeting the lower 128KB of the 1MB address space.
Magnus
On 5/10/2020 6:12 PM, Magnus Karlsson wrote:
FYI, I have worked the last week with Jörg Straube on getting Project
Oberon running from DRAM on the Pipistrello board and I just checked
in the code on github:
See
https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr
It's using a 128KB cache organized as a 2-way 256-set cache with 256
byte cache lines. The interface between the cache and the memory
controller is 128 bits wide @100 MHz, and the memory controller itself
has 800 MB/s peak memory bandwidth.
On power-up the lower 128KB of the 1MB address space is covered by the
cache. The main code for the cache is a simple state machine using
about 150 lines of code with 4 states.
The cache actually covers the lower 8MB address space so in theory we
could have an 8MB Oberon system, but due to a bug somewhere in the
Oberon code it crashes after about 1.25 sec with a trap (C2H on the
LEDs) with more than 1MB of memory. The solution is to have the
non-io address space aliased to the first 1MB. It seems like there
are memory access cycles above 1MB that needs to actually affect the
memory at the first 1MB. I did discover this way back when I did the
2MB version of Pepino and had the tie address bit 20 to 0 for it to
boot (i.e. alias the second MB to the first MB) but never got around
to pinpoint the problem. The same problem popped up again and I was
able to trace it down.
Video memory is in dual-port BRAM and can be relocated by writing to a
new register. At power-up the video is a the normal spot (0E7F00H)
but can be moved up above the 8MB boundary to have a continuous 8MB
memory section for program and data by simply writing to a register
with the new video base address.
Cheers,
Magnus
--
Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems
--
Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems
https://lists.inf.ethz.ch/mailman/listinfo/oberon
Links: ------ [1] https://go.microsoft.com/fwlink/?LinkId=550986 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I think the bug you found was to do with type descriptor access off a pointer, which was fixed a while back.
Hi All, Does this relate to PO2013, too? As I tend to use older versions of h/w synthesis, and also compiler. Can you please point me to the versions wherefrom it was fixed? Many thanks -- Tomas Kral <thomas.kral@email.cz>
Hi Thomas,
Can you please point me to the versions wherefrom it was fixed?
I believe the sign-extended data address Verilog code which Joerg pointed out dates from 2018. So if you have code from before that, and 2MB hardware, you might want to update that - and also I suggest updating the compiler and rebuilding the system. Note that this does not apply to the Spartan 3 reference design or the OberonStation because they have only 1MB. HTH, Paul
Tomas What floating point modules do you have in your build? Very old ones had a rounding error. Jörg Am 11.05.20, 11:17 schrieb "Oberon im Auftrag von Paul Reed" <oberon-bounces@lists.inf.ethz.ch im Auftrag von paulreed@paddedcell.com>: Hi Tomas, >> OberonStation because they have only 1MB. > > I have Pepino 1MB SRAM, am I affected? No you should be fine then. Cheers, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Mon, 11 May 2020 11:54:40 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Tomas What floating point modules do you have in your build? Very old ones had a rounding error. Jörg
==> FPAdder.v <== `timescale 1ns / 1ps // NW 20.9.2015 pipelined // u = 1: FLT; v = 1: FLOOR ==> FPDivider.v <== `timescale 1ns / 1ps // NW 18.9.2015 ORB.Mod.txt:MODULE ORB; (*NW 25.6.2014 / 4.4.2017 in Oberon-07*) ORG.Mod.txt:MODULE ORG; (* NW 18.4.2016 / 4.4.2017 code generator in Oberon-07 for RISC*) ORP.Mod.txt:MODULE ORP; (*N. Wirth 1.7.97 / 4.4.2017 Oberon compiler for RISC in Oberon-07*) ORS.Mod.txt:MODULE ORS; (* NW 19.9.93 / 20.3.2017 Scanner in Oberon-07*) System.Mod.txt:MODULE System; (*JG 3.10.90 / NW 12.10.93 / NW 20.6.2016*) -- Tomas Kral <thomas.kral@email.cz>
On Mon, 11 May 2020 11:54:40 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Tomas What floating point modules do you have in your build? Very old ones had a rounding error. Jörg
==> FPAdder.v <== `timescale 1ns / 1ps // NW 20.9.2015 pipelined // u = 1: FLT; v = 1: FLOOR ==> FPDivider.v <== `timescale 1ns / 1ps // NW 18.9.2015 ==> FPMultiplier.v <== `timescale 1ns / 1ps // NW 15.9.2015 ORB.Mod.txt:MODULE ORB; (*NW 25.6.2014 / 4.4.2017 in Oberon-07*) ORG.Mod.txt:MODULE ORG; (* NW 18.4.2016 / 4.4.2017 code generator in Oberon-07 for RISC*) ORP.Mod.txt:MODULE ORP; (*N. Wirth 1.7.97 / 4.4.2017 Oberon compiler for RISC in Oberon-07*) ORS.Mod.txt:MODULE ORS; (* NW 19.9.93 / 20.3.2017 Scanner in Oberon-07*) System.Mod.txt:MODULE System; (*JG 3.10.90 / NW 12.10.93 / NW 20.6.2016*) -- Tomas Kral <thomas.kral@email.cz>
Tomas There were some enhancements - FPMultiplier 8.8.2016 - FPDivider 16.9.2016 - FPAdder 4.10.2016 - RISC5 31.8.2018, a little speedier ALU implementation in RISC5, Interrupt.. Perhaps it would be worth upgrading to the newest Verilogs Jörg
Am 11.05.2020 um 13:14 schrieb Tomas Kral <thomas.kral@email.cz>:
On Mon, 11 May 2020 11:54:40 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Tomas What floating point modules do you have in your build? Very old ones had a rounding error. Jörg
==> FPAdder.v <== `timescale 1ns / 1ps // NW 20.9.2015 pipelined // u = 1: FLT; v = 1: FLOOR
==> FPDivider.v <== `timescale 1ns / 1ps // NW 18.9.2015
==> FPMultiplier.v <== `timescale 1ns / 1ps // NW 15.9.2015
ORB.Mod.txt:MODULE ORB; (*NW 25.6.2014 / 4.4.2017 in Oberon-07*) ORG.Mod.txt:MODULE ORG; (* NW 18.4.2016 / 4.4.2017 code generator in Oberon-07 for RISC*) ORP.Mod.txt:MODULE ORP; (*N. Wirth 1.7.97 / 4.4.2017 Oberon compiler for RISC in Oberon-07*) ORS.Mod.txt:MODULE ORS; (* NW 19.9.93 / 20.3.2017 Scanner in Oberon-07*) System.Mod.txt:MODULE System; (*JG 3.10.90 / NW 12.10.93 / NW 20.6.2016*)
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Mon, 11 May 2020 13:53:37 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Perhaps it would be worth upgrading to the newest Verilogs
Yes, will do, have to. Looking now at the revision history. These caught my attention. 20160508 - Oberon07.Report.pdf see syntax of module (";" removed) I miss where in the module ";" was removed? 20180918 - considerably less heap space -- ORS.Mod.txt What is the trick to use less heap? Many thanks -- Tomas Kral <thomas.kral@email.cz>
I miss where in the module ";" was removed? I assume the following is meant: PROCEDURE M(): INTEGER; BEGIN Out.Ln RETURN 0 END M; You don‘t need a “;“ before RETURN
20180918 - considerably less heap space -- ORS.Mod.txt What is the trick to use less heap?
I guess it‘s a typo. Must be ORB iso ORS as the scanner doesn’t need heap space. If I rember correctly, some objects unintentionally got allocated more than once. Jörg
Am 11.05.2020 um 14:37 schrieb Jörg:
20180918 - considerably less heap space -- ORS.Mod.txt What is the trick to use less heap?
I guess it‘s a typo. Must be ORB iso ORS as the scanner doesn’t need heap space. If I rember correctly, some objects unintentionally got allocated more than once.
From the relevant diff on Spirit-of-Oberon GitHub I'd say it must be this change in ORB: <https://github.com/Spirit-of-Oberon/wirth-personal/commit/c288d035cbf655031c1e5a7123a81b6aa4e4157d#diff-ee9e5d88425b6bc686e78a7c14b65558R24-R28> In RECORD ObjDesc, two INTEGER fields where changed to BYTE (class, exno) and fields were reordered to reduce alignment overhead, saving 8 bytes in total. I did not verify, but probably this also means that ObjDesc now fits in a smaller heap block than before. Regards, Michael
On Mon, 11 May 2020 15:25:53 +0200 Michael Schierl <schierlm@gmx.de> wrote:
In RECORD ObjDesc, two INTEGER fields where changed to BYTE (class, exno) and fields were reordered to reduce alignment overhead, saving 8 bytes in total. I did not verify, but probably this also means that ObjDesc now fits in a smaller heap block than before.
Michael, I see your point, probably yes, this is it. I did some compare on my local machine, too, and seeing this. I was not too sure what is meant, as it was also hinted, objects were multiply allocated in earlier versions. diff -w ../wirth-personal/personal/wirth/ProjectOberon/Sources/ORB.Mod.txt ORB.Mod.txt.2 1c1 < MODULE ORB; (*NW 25.6.2014 / 17.9.2018 in Oberon-07*) ---
MODULE ORB; (*NW 25.6.2014 / 19.4.2017 in Oberon-07*) 227,228c227 < ELSE < IF class = Const THEN
ELSIF class = Const THEN
231d229 < END 296c294 < IF mod # NIL THEN Files.WriteString(R, mod(Module).orgname); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name) ---
IF mod # NIL THEN Files.WriteString(R, mod.name); Files.WriteInt(R, mod.val); Files.WriteString(R, obj.name)
-- Tomas Kral <thomas.kral@email.cz>
Oh, so it is/was a bug in the risc5 verilog code. I actually got the RISC5 source code from emard (https://github.com/emard/oberon) where the cpu clock enable signal was added. I agree, updating to the latest version would be good. I will pick it up from Project Oberon and create a new bit file. Magnus On 5/11/2020 1:37 AM, Paul Reed wrote:
Hi Joerg, Magnus,
Surely that's to do with data access not jumps? But anyway, I believe updating the Verilog will indeed fix the 2MB problem, it did for me. I think the bug you found was to do with type descriptor access off a pointer, which was fixed a while back. Apologies for this!
Hope that helps - and thanks for your efforts! Paul
On 2020-05-11 09:31, Jörg Straube wrote:
Magnus
Don’t know if this is the culprit:
There was this line in the RISC5.v you used:
assign adr = stallL ? B[23:0] + {4'b0, off} : {pcmux, 2'b00};
For backward jumps this would be better
assign adr = stallL ? B[23:0] + {{4{off[19]}}, off} : {pcmux, 2'b00};
I’m in the process to verify and will include the newest enhancements and bug fixes in the Verilog files. (rounding error in floating points, new shifter and registers…) and compiler.
br
Jörg
The project have been updated at https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr This version is based on the current RISC5 verilog code (dated 11.12.2018). System info: Cache size: 128 KB (2-way 256-set). Cached area: lower 15.75 MB of the RISC5 memory map is mapped to cache/lpddr memory. The non-cached area (top 256 KB of the RISC5 memory map) is used for I/O (top 4KB), boot prom (next 4KB), then a free 248 KB area where the video display buffer can be relocated . Video buffer is in BRAM and is located at the default place at power up but can be relocated anywhere in the memory map by simply writing to a new 24-bit video base register. Since the video frame buffer is in non-cached BRAM there is no need to flush the cache, which btw uses write-back policy. The system will be slowed down by cache misses but there is about 11% gain by having the video buffer in BRAM (no cpu stalls due to video controller memory access). Magnus On 5/11/2020 7:01 AM, Magnus Karlsson wrote:
Oh, so it is/was a bug in the risc5 verilog code.
I actually got the RISC5 source code from emard (https://github.com/emard/oberon) where the cpu clock enable signal was added. I agree, updating to the latest version would be good. I will pick it up from Project Oberon and create a new bit file.
Magnus
On 5/11/2020 1:37 AM, Paul Reed wrote:
Hi Joerg, Magnus,
Surely that's to do with data access not jumps? But anyway, I believe updating the Verilog will indeed fix the 2MB problem, it did for me. I think the bug you found was to do with type descriptor access off a pointer, which was fixed a while back. Apologies for this!
Hope that helps - and thanks for your efforts! Paul
On 2020-05-11 09:31, Jörg Straube wrote:
Magnus
Don’t know if this is the culprit:
There was this line in the RISC5.v you used:
assign adr = stallL ? B[23:0] + {4'b0, off} : {pcmux, 2'b00};
For backward jumps this would be better
assign adr = stallL ? B[23:0] + {{4{off[19]}}, off} : {pcmux, 2'b00};
I’m in the process to verify and will include the newest enhancements and bug fixes in the Verilog files. (rounding error in floating points, new shifter and registers…) and compiler.
br
Jörg
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I have made updates to the code on github with the following changes: * The code now has it's own repository with a master branch and two versions with color display added * The mono display buffer in BRAM is now 160 KB, big enough for a 1440x900 display * The CPU clock is now coming from the memory controller PLL, leaving the video PLL free to implement any frequency needed by the video controller * The cache is now 64KB (2-way, 128-set, 256 bytes/cache line) to make room for the larger mono display buffer * The color version have 8 bpp or 16 bpp color video added in parallel with the mono display. 8 bpp needs 1.5 MB memory, 16 bpp needs 3 MB memory for display buffer * The color buffer can be at any place in the 15.75 MB lpddr memory space (aligned to 16 bytes) controlled by a color buffer address register * When using color display the cache needs to be flushed. There are several ways to flush the cache - on demand by software, on every vsync and using auto-flush where a cache line is flushed every 1024 CPU clocks. * The selection between mono display and color display is via a register bit. Jörg Straube have successfully shown the code working in both 1440x900 mono display mode and 8 bpp color display mode. https://github.com/Saanlima/RISC5Verilog_lpddr Cheers, Magnus On 5/15/2020 7:53 AM, Magnus Karlsson wrote:
The project have been updated at https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr This version is based on the current RISC5 verilog code (dated 11.12.2018).
System info: Cache size: 128 KB (2-way 256-set). Cached area: lower 15.75 MB of the RISC5 memory map is mapped to cache/lpddr memory. The non-cached area (top 256 KB of the RISC5 memory map) is used for I/O (top 4KB), boot prom (next 4KB), then a free 248 KB area where the video display buffer can be relocated . Video buffer is in BRAM and is located at the default place at power up but can be relocated anywhere in the memory map by simply writing to a new 24-bit video base register. Since the video frame buffer is in non-cached BRAM there is no need to flush the cache, which btw uses write-back policy. The system will be slowed down by cache misses but there is about 11% gain by having the video buffer in BRAM (no cpu stalls due to video controller memory access).
Magnus
Correction: 8 bpp needs 0.75 MB memory, 16 bpp needs 1.5 MB memory for display buffer On 5/27/2020 3:50 PM, Magnus Karlsson wrote:
I have made updates to the code on github with the following changes:
* The code now has it's own repository with a master branch and two versions with color display added * The mono display buffer in BRAM is now 160 KB, big enough for a 1440x900 display * The CPU clock is now coming from the memory controller PLL, leaving the video PLL free to implement any frequency needed by the video controller * The cache is now 64KB (2-way, 128-set, 256 bytes/cache line) to make room for the larger mono display buffer * The color version have 8 bpp or 16 bpp color video added in parallel with the mono display. /8 bpp needs 0.75 MB memory, 16 bpp needs 1.5 MB memory for display buffer / * The color buffer can be at any place in the 15.75 MB lpddr memory space (aligned to 16 bytes) controlled by a color buffer address register * When using color display the cache needs to be flushed. There are several ways to flush the cache - on demand by software, on every vsync and using auto-flush where a cache line is flushed every 1024 CPU clocks. * The selection between mono display and color display is via a register bit.
Jörg Straube have successfully shown the code working in both 1440x900 mono display mode and 8 bpp color display mode.
https://github.com/Saanlima/RISC5Verilog_lpddr
Cheers, Magnus
On 5/15/2020 7:53 AM, Magnus Karlsson wrote:
The project have been updated at https://github.com/Saanlima/Pipistrello/tree/master/Projects/Oberon_lpddr This version is based on the current RISC5 verilog code (dated 11.12.2018).
System info: Cache size: 128 KB (2-way 256-set). Cached area: lower 15.75 MB of the RISC5 memory map is mapped to cache/lpddr memory. The non-cached area (top 256 KB of the RISC5 memory map) is used for I/O (top 4KB), boot prom (next 4KB), then a free 248 KB area where the video display buffer can be relocated . Video buffer is in BRAM and is located at the default place at power up but can be relocated anywhere in the memory map by simply writing to a new 24-bit video base register. Since the video frame buffer is in non-cached BRAM there is no need to flush the cache, which btw uses write-back policy. The system will be slowed down by cache misses but there is about 11% gain by having the video buffer in BRAM (no cpu stalls due to video controller memory access).
Magnus
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (7)
-
Jörg -
Jörg Straube -
Magnus Karlsson -
Michael Schierl -
Paul Reed -
Skulski, Wojciech -
Tomas Kral