Skip to content

Instantly share code, notes, and snippets.

@errordeveloper
Created August 1, 2011 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save errordeveloper/1118537 to your computer and use it in GitHub Desktop.
Save errordeveloper/1118537 to your computer and use it in GitHub Desktop.
Makefile for Verilator
%.newdir:
mkdir -p $(@:.newdir=) && cd $(@:.newdir=)
%.delete:
rm -rf $(@:.delete=)
test:
@echo "\
module our;\n\
initial begin $$ \bdisplay(\"Hello World\");\n$$ \bfinish;\nend\n\
endmodule" \
> $@.v
@echo "\
#include \"Vour.h\"\n\
#include \"verilated.h\"\n\
int main(int argc, char **argv, char **env) {\n\
Verilated::commandArgs(argc, argv);\n\
Vour* top = new Vour;\n\
while (!Verilated::gotFinish()) { top->eval(); }\n\
exit(0);\n\
}"\
> $@.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment