mirror of
https://github.com/nickmqb/wyre.git
synced 2025-12-06 02:30:42 -08:00
1.5 KiB
1.5 KiB
Getting started
Building the compiler
You can choose between the following two options:
From .mu source
- Install the Muon compiler.
- Clone this repo
- Go to the compiler directory (in this repo)
- Compile .mu sources:
mu --args wyre.args - Use a C compiler to compile wyre.c. E.g.:
- GCC:
gcc -o wyre wyre.c - MSVC:
cl /Zi wyre.c
- GCC:
- You now have a Wyre compiler!
From .c
If you prefer to not install Muon, you can take a shortcut:
- Clone this repo
- Go to the dist directory
- Compile wyre.c with a C compiler of your choice (see instructions above)
- You now have a Wyre compiler!
Running the compiler
The syntax for invoking the compiler is as follows:
wyre [flag] [source_file.w] [flag] [source_file.w] ...
Source files and flags may be mixed and may be specified in any order.
Supported flags:
--output [path]. The output of the compiler, a Verilog file.--top [module]. Name of the topmost module in the design.--indent [n]. Tab size, in spaces (learn more about significant whitespace). Set to 0 to ignore.--max-errors [n]. Maximum number of compile errors to display.
To compile the led example:
- Navigate to the
examplesdirectory. - Run:
wyre led.w --output led.v --top top --indent 4 --max-errors 20
Tip: to avoid having to specify all arguments every time you invoke the compiler, it is recommendeded to create a short shell script (.sh) or batch file (.bat) that contains the command.