The Sail ISA specification language
github.com
github.com
If you don't care about compiler performance, auto-generating a compiler backend from scratch is already highly non-trivial. Sail's constrained nature may help a little but not that much, as you essentially need to auto-understand an interpreter for a Turing-complete language. If you do want performance, the problem becomes much harder still. One of the biggest problems in compiler performance is the memory model: what reordering is permitted, what is prohibited to the optimiser? Sail does not address this. Instead, (like all similar languages) it 'handles' main memory access by two uninterpreted functions which are (roughly) "memory read" and "memory write" That's a polite way of saying: Sail (like all similar languages) leaves this particular problem to the user.
There are open research questions here.
Save Intel's compiler, do any rely on implementation details? They rely on cache and fetch details, but only in broad, nebulous ways that seem very portable.
There may be open research questions but it seems to me the biggest thing is paying someone to do it.
I think you a word while reading.
*'mostly' because there was a research group that was working on tools that would read the word docs and do some automation, though they seemed mostly still experimental... and it also seemed like a really bad way to approach the problem, but they were working with what the designers were used to - Word Docs.
Why? Because Sail does not offer abstractions for clocked digital circuits, which is what characterises the RTL. The most widely used DSL for the RTL is (System)Verilog [3]. Instead, Sail is a stand-alone DSL for the ISA (= instruction set architecture). The purpose of the ISA level is to talk about that a processor looks from the outside, to the programmer (most specifically to the compiler writer). Sail is a minimal programming language with a single purpose: writing ISA specifications, which means writing an interpreter for assembly language. Technically, Sail is a simple imperative language with first-order functions. What makes Sail suitable for specifying ISAs is its typing system. Sail supports types that are frequently used in ISA interpreters, such as dependent typing for numeric types and bitvector lengths. Sail is closely related to Arm's ASL (= architecture specification language) [2].
Since Sail is Turing-complete, any ISA can be modelled, including Mill. For the same reason any RTL can be modelled, for example by coding up an interpreter for an RTL language like Verilog, but that would be mighty inconvenient.
[1] https://en.wikipedia.org/wiki/Register-transfer_level
For instance one of GCCs intermediate representations really reminds me of Sail. https://gcc.gnu.org/onlinedocs/gccint/RTL.html