You can choose between the following two options:
- Install the Muon compiler.
- Clone this repo. When choosing a local path, ensure that the muon and wyre repos are in the same directory. Alternatively, edit compiler/wyre.args and update the Muon standard library path before building.
- 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!
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!
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 leds example:
- Navigate to the
examples
directory. - Run:
wyre leds.w --output leds.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.