2023-08-07 18:53:36 -05:00
|
|
|
PROGRAM_PREFIX :=
|
|
|
|
|
2023-12-12 16:34:42 -06:00
|
|
|
YOSYS ?= ../../../../$(PROGRAM_PREFIX)yosys
|
2014-06-22 05:50:29 -05:00
|
|
|
|
2024-10-07 03:56:23 -05:00
|
|
|
.PHONY: all dots examples
|
|
|
|
all: dots examples
|
2024-10-16 10:40:21 -05:00
|
|
|
dots: test1.dot my_cmd.so
|
|
|
|
examples: test0.log test1.log test2.log my_cmd.so
|
2023-12-12 16:34:42 -06:00
|
|
|
|
2023-08-07 18:53:36 -05:00
|
|
|
CXXFLAGS=$(shell $(YOSYS)-config --cxxflags)
|
|
|
|
DATDIR=$(shell $(YOSYS)-config --datdir)
|
2020-05-30 04:21:40 -05:00
|
|
|
|
2014-06-22 05:50:29 -05:00
|
|
|
my_cmd.so: my_cmd.cc
|
2024-01-24 17:35:03 -06:00
|
|
|
$(YOSYS)-config --exec --cxx $(subst $(DATDIR),../../../../share,$(CXXFLAGS)) --ldflags -o my_cmd.so -shared my_cmd.cc --ldlibs
|
2014-06-22 05:50:29 -05:00
|
|
|
|
|
|
|
test0.log: my_cmd.so
|
2024-04-12 18:33:04 -05:00
|
|
|
$(YOSYS) -QTl test0.log_new -m ./my_cmd.so -p 'my_cmd foo bar' -f verilog absval_ref.v
|
2014-06-22 05:50:29 -05:00
|
|
|
mv test0.log_new test0.log
|
|
|
|
|
|
|
|
test1.log: my_cmd.so
|
2024-04-12 18:33:04 -05:00
|
|
|
$(YOSYS) -QTl test1.log_new -m ./my_cmd.so -p 'clean; test1; dump' -f verilog absval_ref.v
|
2014-06-22 05:50:29 -05:00
|
|
|
mv test1.log_new test1.log
|
|
|
|
|
2024-01-24 17:35:03 -06:00
|
|
|
test1.dot: my_cmd.so
|
2023-12-12 16:34:42 -06:00
|
|
|
$(YOSYS) -m ./my_cmd.so -p 'test1; show -format dot -prefix test1'
|
|
|
|
|
2014-06-22 05:50:29 -05:00
|
|
|
test2.log: my_cmd.so
|
2024-04-12 18:33:04 -05:00
|
|
|
$(YOSYS) -QTl test2.log_new -m ./my_cmd.so -p 'hierarchy -top test; test2' -f verilog sigmap_test.v
|
2014-06-22 05:50:29 -05:00
|
|
|
mv test2.log_new test2.log
|
|
|
|
|
2024-01-24 17:35:03 -06:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f *.d *.so *.dot
|