Skip to content

Commit

Permalink
Merge pull request #954 from riscv/make_code
Browse files Browse the repository at this point in the history
Revive `make debug_defines` and `make chisel`
  • Loading branch information
wmat authored Jan 12, 2024
2 parents 6f5d040 + e832592 commit f56679a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ REGISTERS_ADOC += abstract_commands.adoc
REGISTERS_ADOC += sw_registers.adoc
REGISTERS_PY = ../registers.py

REGISTERS_CHISEL += dm_registers.scala
REGISTERS_CHISEL += abstract_commands.scala

ASCIIDOCTOR_PDF := asciidoctor-pdf
OPTIONS := --trace \
-a compress \
Expand Down Expand Up @@ -66,6 +69,21 @@ build-registers: $(REGISTERS_ADOC)
%.adoc: ../xml/%.xml $(REGISTERS_PY)
../registers.py --adoc $@ --adoc-definitions $(patsubst %.adoc,%-def.adoc,$@) $<

debug_defines: debug_defines.h debug_defines.c $(patsubst %,../xml/%,$(REGISTERS_ADOC:.adoc=.xml)) ../registers.py
../registers.py $@ --cgetters $(filter %.xml, $^)

debug_defines.%:
echo "/*" > $@
echo " * This file is auto-generated by running 'make debug_defines' in" >> $@
echo " * https://github.com/riscv/riscv-debug-spec/ (`git describe --always --dirty --exclude '*'`)" >> $@
echo " */" >> $@
echo >> $@

%.scala: ../xml/%.xml ../registers.py
../registers.py --chisel $(basename $@).scala $< > /dev/null

chisel: $(REGISTERS_CHISEL)

clean:
@echo "Cleaning up generated files..."
rm -f $(PDF_RESULT) $(REGISTERS_ADOC)
Expand Down

0 comments on commit f56679a

Please sign in to comment.