microCore-VHDL / microCore

Hardware/Software Co-design environment of a processor core for deterministic real time systems
37 stars 3 forks source link

A to do list please #3

Closed PythonLinks closed 1 year ago

PythonLinks commented 1 year ago

This is a very interesting project. I am doing a master's program in digital design, and am planning on doing something with this. Not quite sure what. Add a few functions, turn it into a barrel processor, maybe write a python simulator, or convert to verilog. Maybe something else.

Do you have any changes you want made to this design? Any wish list? Is it just perfect as is?

Also a link to your website from this repository would be helpful. Maybe there is one, but i did not see it. Is this you? https://microcore.org/

You mention RS232. I do not have an RS202 cable. All of my cables are usb. Sure I can buy a converter, but it would be nice if your device supported USB. Maybe it does.

Some statement about what limits the clock speed would be interesting. What is the slowest module, aside from two clocks to read data?

Is anyone interested in a whole bunch of these running on an FPGA?

Personally I like the idea of lots of forth words implemented. But the mainstream world does not like that, they like lots of small instructions, so some defense of it would be most interesting to read.

A link to your microcore talks would be most interesting . I found this one. https://www.youtube.com/watch?v=KUem5EREkAI Have you done any other talks in the past? And if you are doing a talk at the German forth user group this week, a link to a youtube recording (with English Subtitles) after the event would be most wonderful.

microCore-VHDL commented 1 year ago

Do you have any changes you want made to this design? Any wish list? Is it just perfect as is?

I have no changes. The development startet in 2001 and it definitely has matured. I modified the instruction set several times but the source code remained the same. Instruction changes have been hidden using appropriate macros or calls. The next big step would be a core with 16 bit instructions. That should result in a 5 times throughput increase. Personally, I have never reached the performance limit of uCore using it for embedded control systems, see uCore-Applications.pdf for a talk on projects I have done with it. uForth.pdf discusses some of the challenges of the cross-compiler.

My wish: Optimization of the instruction codes. As you will find out when you modify the instruction constants in architecture_pkg.vhd, the assignment of code-numbers to instructions has an influence on the synthesizer results and the number of logic blocks used. Therefore, I am still dreaming of an optimization suite that replaces the numbers by states of an 'instructions' type vector. Letting the state machine optimizer of the synthesizer work on this should produce an optimum opcode assignment for each instruction w.r.t. resource usage.

Also a link to your website from this repository would be helpful. Maybe there is one, but i did not see it. Is this you? https://microcore.org/

This WAS me. I let microcore.org expire. But mysteriously, it is still there showing a completely outdated design. After 20+ years I am unhappy with the name 'microCore'. For one thing, its not 'micro', it became high performance. I would like to rename it forthCore instead. Which is also a sort of misnomer, because after all it is a high performance processor that can efficiently execute almost every high-level language. The unusual requirement for a 'language' front-end is that uCore requires stack allocation rather than register allocation for efficiency.

You mention RS232. I do not have an RS232 cable. All of my cables are usb. Sure I can buy a converter, but it would be nice if your device supported USB. Maybe it does.

It does not. If you want to implement a serial usb transceiver on both sides (host and target): Go ahead. Good luck. A USB to RS232 converter from Prolific is perfect, because it does not introduce delays in the communication as most other USB converters do. And when you port uCore to another project, you just have to set aside one input and one output pin for the umbilical link that connects to the debugger on the host.

Some statement about what limits the clock speed would be interesting. What is the slowest module, aside from two clocks to read data?

I never took the time to analyze this, because I always had a concrete problem that needed to be solved. And - as I said above - uCore always outperformed my applications. Even if you can pinpoint a certain instruction to be the limiting factor: There is not much what you could do besides dividing up the functionality into two instructions, which will always be assembled using a macro.

Is anyone interested in a whole bunch of these running on an FPGA?

Not that I knew. I have the impression that this is an interesting research topic, but I don't see real applications let alone customers. At least in the field of embedded systems.

Personally I like the idea of lots of forth words implemented. But the mainstream world does not like that, they like lots of small instructions, so some defense of it would be most interesting to read.

It took me a long time to decide, which Forth instructions are really necessary. In the end I decided that everything that can be done in two instruction macros are not worthy of a single instruction. In uCore there are lots of 'small instructions' but also quite complex ones. Because we know from 50 years of using Forth that those are important. This is the type of know-how 'general purpose' machines can not build on. Usually, the utmost they do, are 'frame' / 'unframe' multi-cycle instructions, which are needed, because the damn thing has only one stack. This also produces a dissuasive runtime overhead for function calls. Btw: Poor_man's_compilers is a paper on why I love Forth.

A link to your microcore talks would be most interesting . I found this one. https://www.youtube.com/watch?v=KUem5EREkAI. Have you done any other talks in the past?

I have done a several talks on the monthly FIG and Forth2020 zoom conferences. Check youtube and search for 'schleisiek microcore'.

PythonLinks commented 1 year ago

Thank you for all of the excellent answers. And for generously sharing your expertise.

50 words selected over 50 years. That is a lot of work. And you said all of your projects were in Forth. One word a year. No wonder you did not run into performance limitations. You had very expressive forth words on your side. I will have to read the list again. I will have to read all of your comments again.

I would not change the name, much as you might want to. Too many mentions of this name. Links from the web would all get broken.

Maybe you started when you were 25. Plus 50 years. Would make you 75. I am mindful that Chuck Moore recently retired. Dr. Ting passed recently. All of the Forth meetings are full of balding people like myself. As if the expertise may all disappear some day.

In the meantime, I am busy reading deeper into all of these Forth CPUs. Lots to learn from all of them.

microCore-VHDL commented 1 year ago

Am 07.05.23 um 19:57 schrieb PythonLinks:

50 words selected over 50 years.

There is a misunderstanding. 50+ years of Forth (since Chuck wanted to call it 'Fourth') have produced a number of words, which are generally agreed in the community of being "essential" to tackle a specific problem area. Some of those have a high semantic content, i.e. they are anything but "simple". Yet Forth usage proves that they are "important". This is the advantage of designing a processor, whose assembler was first and whose hardware second. Personally, I'm using Forth almost exclusively since 1981 and I am 72 now.

As if the expertise may all disappear some day.

Perhaps. But there is hope. The academic compiler gurus are getting second thoughts about grammar based systems in contrast to concatenative 'lexicon' (aka dictionary) based systems like Forth, LISP, and a few others. I wrote "Poor man's compilers" (attached PDF) for an academic working group on "computer architecture and compiler design", because they don't know how simple lexical scanning only looking for whitespace and compilation using immediate words can be. Those and the dictionary are the enabling technologies for extensibility. Much like postfix literals and Harvard architecture (separate program memory) are the enabling technologies for the freely configurable data word width.

The latter did allow for the comprehensive brute-force test of the multiply/divide instructions, which only needs 3 hours on a 10 bit system (20 bit dividend, 10 bit divisor). See: https://github.com/microCore-VHDL/LFXP2_8_protoboard/tree/main/software/test/division.

:)

Klaus Schleisiek Am Elbufer 8 D-29478 Höhbeck-Vietze 05846 9804008