Commit 8dfcfe1d authored by cota's avatar cota

Use squish to build wbgen2

Using squish allows us to include source files or modules into
our generated program in a portable way.

This patch changes the build procedure to use squish.
Signed-off-by: Emilio G. Cota's avatarEmilio G. Cota <cota@braap.org>

git-svn-id: http://svn.ohwr.org/wishbone-gen@7 4537843c-45c2-4d80-8546-c3283569414f
parent 1415e583
...@@ -6,7 +6,7 @@ VERILOG_LIBRARY = $(VHDL_LIBRARY:.vhd=.v) ...@@ -6,7 +6,7 @@ VERILOG_LIBRARY = $(VHDL_LIBRARY:.vhd=.v)
all: $(SOURCES) all: $(SOURCES)
# make -C utils/vhd2vl/src # make -C utils/vhd2vl/src
./utils/process_dofiles.lua wbgen_main.lua wbgen2 squish
chmod +x wbgen2 chmod +x wbgen2
.PHONY: all clean .PHONY: all clean
......
-- Squish - One language to write them all, one squisher to squish them
-- http://matthewwild.co.uk/projects/squish/readme.html
Option "executable"
Output "wbgen2"
Main "wbgen_common.lua"
Main "cgen_common.lua"
Main "cgen_vhdl.lua"
Main "cgen_verilog.lua"
Main "cgen_c_headers.lua"
Main "cgen_doc.lua"
Main "wbgen_regbank.lua"
Main "wbgen_rams.lua"
Main "wbgen_eic.lua"
Main "target_wishbone.lua"
Main "wbgen_main.lua"
#!/usr/bin/lua
if(arg[2] == nil) then
print( "usage: process_dofiles input.lua output_combined.lua");
os.exit(0);
end
local fin = io.open(arg[1],"r");
local fout = io.open(arg[2],"w");
function include_file(name)
local f= io.open(name,"r");
while true do
local line = fin.read(f);
if(line == nil) then break; end
if(string.match(line,"^#!") == nil) then
fout.write(fout, line.."\n");
end
end
io.close(f);
end
while true do
local line = fin.read(fin);
if(line == nil) then break; end
local fname = string.match(line,"^my_dofile%(\"(%S+)\"%)");
if(fname ~= nil) then
print("Including "..fname);
include_file(fname);
else
fout.write(fout, line.."\n");
end
end
io.close(fin);
...@@ -26,22 +26,6 @@ options.target_interconnect = "wb-classic"; ...@@ -26,22 +26,6 @@ options.target_interconnect = "wb-classic";
options.register_data_output = false; options.register_data_output = false;
options.lang = "vhdl"; options.lang = "vhdl";
function my_dofile(name)
dofile("~/wbgen2_svn/wbgen2/"..name);
end
my_dofile("wbgen_common.lua");
my_dofile("cgen_common.lua");
my_dofile("cgen_vhdl.lua");
my_dofile("cgen_verilog.lua");
my_dofile("cgen_c_headers.lua");
my_dofile("cgen_doc.lua");
my_dofile("wbgen_regbank.lua");
my_dofile("wbgen_rams.lua");
my_dofile("wbgen_eic.lua");
my_dofile("target_wishbone.lua");
function parse_args(arg) function parse_args(arg)
local n=1; local n=1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment