<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Wojtek<div><br></div><div>I admit that the address fixing is not the easiest part of a compiler and module loader, but it is not undocumented.<div>The first paragraph of  chapter 12.7.9 in this document <a href="https://inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf">https://inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf</a> explains what the compiler generates, why its doing it and what fields the module loader has to extract so he can modify the instruction while loading the module from disk to memory.</div><div><br></div><div>BTW: The CPU instruction set of NW’s RISC-5 is documented here:</div><div><a href="https://inf.ethz.ch/personal/wirth/FPGA-relatedWork/RISC-Arch.pdf">https://inf.ethz.ch/personal/wirth/FPGA-relatedWork/RISC-Arch.pdf</a></div><div>After reading it, you might understand that 0F7000000H is the assembler code for „BL always“</div><div><br></div><div>This Oberon code is totally agnostic to the used FPGA as long as the FPGA implements NW’s CPU called RISC-5. (to be found in RISC5.v)</div><div>You can leave this Oberon code untouched.</div><div>You „only“ have to make sure RISC5.v and more importantly RISC5Top.v is adapted to your FPGA and especially memory (address and timing)</div><div><br><div dir="ltr"><div>Jörg</div></div><div dir="ltr"><br><blockquote type="cite">Am 13.11.2019 um 20:33 schrieb Skulski, Wojciech <skulski@pas.rochester.edu>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Peter:</span><br><span></span><br><span>  thank you for asking. RiskFive is low priority because it is at the sidelines of our funded work. Vedant is using one of these boards and I have four more piled on my desk. As of now Vedant has implemented Wiznet W5500 and he is now working on W5300. All this work was MicroBlaze and C because he is following Pong P. Chu firmware. My tentative plan is to let him complete this work, after which one of us will wrap RISC5 the same way as the MicroBlaze Controller System (MCS) from Xilinx. If RISC5 becomes a drop-in replacement for the MCS, then all the other firmware can stay in place. </span><br><span></span><br><span>Implementing the W5300 reqired changing the address map from Pong P. Chu to wider address chunks per module, because PP.Chu provides for only 32 memory locations, while W5300 needs 32 kB. This is a minor change, which is greatly facilitated by the modular structure of P.P.Chu bus. Interestingly enough, NW/PR bus is basically the same as the P.P.Chu bus, but it is documented in a different way. It turns out that the "bus" does not really exist inside the FPGA. All that exists is its documentation. You can read the WishBone document where they clearly say that WishBone is a specification rather than a firmware component. Much the same is true about NW/PR, P.P.Chu, and other such buses. I tentatively decided to adopt FPro by P.P.Chu because it is both simple and extensively documented. After changing the memory map we will rename it to SPro to avoid confusion with his FPro specs. </span><br><span></span><br><span>All this is firmware. My aim is development of a firmware framework with larger memory address range per chunk than FPro is providing, and then adopting P.P.Chu components to build a system on chip for our needs. Part of this work which of general interest can be open sourced, after writing and releasing sufficient documentation.</span><br><span></span><br><span>I reviewed the current Oberon System software from the point of view of porting it to a future SoC. I found that the low level modules such as Kernel, Display, Files, </span><br><span>or a boot loader, will all need to be factored into a low level driver layer with the HW addresses, and the upper layer without. This is perhaps stated in the NW book, but this book does not accurately describe the Oberon System reality. In reality there are numbers literally hardcoded inside the modules in more than one place. For example, at the end of the BootLoader, the locations 12 and 24 are loaded with values. Now imagine porting this software to another SoC. How do you make sure that these values are properly interfaced with hardware if it is not clear what is going on. It happens in many places in the low level drivers.</span><br><span></span><br><span>My favorite lines of code in Modules.Mod are:</span><br><span></span><br><span>          mno := inst DIV 100000H MOD 10H;</span><br><span>          pno := inst DIV 1000H MOD 100H;</span><br><span>          disp := inst MOD 1000H;</span><br><span>          ....</span><br><span>          SYSTEM.PUT(adr, (offset MOD 1000000H) + 0F7000000H);</span><br><span></span><br><span>Now imagine porting such undocumented code to range of different SoCs with different memory arrangements. It looks like a recipe for a disaster to me. It will be necessary to rewrite portions of low-level Oberon System code to factor out such pieces, before porting the system to other boards which are substantially different from the present boards. Documentation will be crucial. None of such literal values should be allowed in the portable code without extensive comments describing the mechanics. Such structural fixes would be needed before this software is portable to a different SoC. </span><br><span></span><br><span>It would be helpful if this community formed a task force to start modernizing the FPGA Oberon System. The first modest task of the task force could be commenting and documenting the low level code, as well as moving all the hardcoded locations into the definition module SysDef.Mod corresponding to the firmware memory locations. (Consult the P.P.Chu book where he is doing exactly that.)</span><br><span></span><br><span>Forming a task force could be contrary to the culture of this group. We seem to be very individualistic. And we do not seem to have a clear common goal. </span><br><span></span><br><span>I can circulate a draft review of the low level Oberon System if there is interest. </span><br><span></span><br><span>Thank you again for asking. And I want to profusely apologize to anyone who could read this e-mail as being unduly critical.</span><br><span></span><br><span>Wojtek</span><br><span>________________________________________</span><br><span>From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of peter@easthope.ca [peter@easthope.ca]</span><br><span>Sent: Wednesday, November 13, 2019 12:55 PM</span><br><span>To: oberon@lists.inf.ethz.ch</span><br><span>Subject: [Oberon]  RiskFive; was Oberon on ULX3S explanation</span><br><span></span><br><span>Wojciech,</span><br><span>is RiskFive still viable?  The last news on your site is 2018,</span><br><span>November.  Not criticizing; just wondering.</span><br><span></span><br><span>Thanks            ... L.</span><br><span></span><br><span>--</span><br><span>Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems</span><br><span>https://lists.inf.ethz.ch/mailman/listinfo/oberon</span><br></div></blockquote></div></div></body></html>