GNUmakefile 4.9 KB
#!smake
#
# rdpsim/tools/Makefile
#
#

PRDEPTH = ../..

include $(PRDEPTH)/PRdefs
#
#  F l a g s
#
ECSINC = /hosts/venice/ecad/ecs_released/include
ECSLIB = /hosts/venice/ecad/ecs_released/lib
YFLAGS = -d -v
LCINCS = -I../simlib -I$(ROOT)/usr/include/PR
LCOPTS = -g
CC=$(HOST_CC)
GCINCS=-D_LANGAUGE_C
GLDOPTS=
#
#  Source for converting tabular file to Compass Wave format
#
TAB2WVSSRC =    tab2wvs.c \
                tab2wvs_gram.c

TAB2WVSOBJ =    $(TAB2WVSSRC:.c=.o)
#
#  Source for converting tabular file to Compass Qsim format
#
TAB2SIMSRC =    tab2sim.c \
                tab2sim_gram.c

TAB2SIMOBJ =    $(TAB2SIMSRC:.c=.o)
#
#  Source for converting tabular file to Verilog mem file and driver
#
TAB2VMEMSRC =   tab2vmem.c \
                tab2vmem_gram.c

TAB2VMEMOBJ =    $(TAB2VMEMSRC:.c=.o)
#
#  Source for printing vertical signal names in tabular file
#
VSIGSRC =   vsig.c \
	    vsig_gram.c

VSIGOBJ =    $(VSIGSRC:.c=.o)
#
#  Extract bits from one word and place in another.
#
BITSSRC =   bits.c \
	    bits_gram.c

BITSOBJ =    $(BITSSRC:.c=.o)
#
#  T a r g e t s
#
TARGETS = tab2wvs tab2vmem vsig xnet remove_comments ecs_gen merrg setup a2b b2a b2mem rdp2read main2image blink flat_shade_dl iclr bincut do_wave tab2sim make_movie main2rdp rdram2rdp

INST_TARGETS = rdp2read

#
#  Remove these intermediate files: make clobber
#
LDIRT = tab2wvs_scan.c  \
	tab2wvs_gram.c	\
	test.wvs \
	test.tbl \
	tab2sim_scan.c  \
	tab2sim_gram.c	\
	tab2vmem_scan.c  \
	tab2vmem_gram.c	\
	vsig_scan.c \
	vsig_gram.c \
	test.vmem \
	driver.v \
	y.output

#
#  Both tab2wvs and tab2vmem use yacc, so we single thread
#  as to avoid stomping on each other's y.tab.c.
#
.NOTPARALLEL:

default: $(TARGETS) test.wvs

exports install : default
	$(INSTALL) -m 555 -F /usr/sbin $(TARGETS)

include $(COMMONRULES)

#
#  Tool for converting Viewlogic netlist, confguration file
#  to C or Verilog wrapper functions for co-simulation.
#
xnet:	xnet.c

#
#  Tool for converting ECS netlist to Viewlogic format
#
ecs2vl:	ecs2vl.c
	rcp ecs2vl.c guest@amber:ecs2vl.c
	rsh guest@amber $(CC) -o ecs2vl -DUNIX -I. \
		-I$(ECSINC) ecs2vl.c \
		$(ECSLIB)/scpik.a
	rcp guest@amber:ecs2vl ecs2vl

#
#  Tool for converting tabular file to Compass Wave format
#
tab2wvs_gram.y: tab2wvs_scan.c

tab2wvs: $(TAB2WVSOBJ)
	$(HOST_CC) -o $@ $(TAB2WVSOBJ) -ll

#
#  Tool for converting tabular file to Compass QSim format
#
tab2sim_gram.y: tab2sim_scan.c

tab2sim: $(TAB2SIMOBJ)
	$(HOST_CC) -o $@ $(TAB2SIMOBJ) -ll -lm

#
#  Example of how to use tab2wvs
#
test.wvs:  test_tab2wvs.tab tab2wvs
	./tab2wvs -o test.tbl test_tab2wvs.tab > test.wvs
#
#  Tool for converting tabular file to Verilog memory file and driver
#
tab2vmem_gram.y: tab2vmem_scan.c

tab2vmem: $(TAB2VMEMOBJ)
	$(HOST_CC) -o $@ $(TAB2VMEMOBJ) -ll

#
#  Tool for printing vertical signal names in tabular file
#
vsig_gram.y: vsig_scan.c

vsig: $(VSIGOBJ)
	$(HOST_CC) -o $@ $(VSIGOBJ) -ll

#
# 
#
bits_gram.y: bits_scan.c

bits: $(BITSOBJ)
	$(HOST_CC) -o $@ $(BITSOBJ) -ll

#
#  rdp2read
#
rdp2read: rdp2read.c
	$(HOST_CC) -D_LANGUAGE_C -o $@ $@.c -I../../include -I$(ROOT)/host_include
#
#  main2image
#
main2image: main2image.c
	$(HOST_CC) -o $@ $@.c -I../../include -I$(ROOT)/host_include -L$(ROOT)/host_lib -limage

#
#  flat_shade_dl
#
flat_shade_dl: flat_shade_dl.c
	$(HOST_CC) -o $@ $@.c -I../../include -I$(ROOT)/host_include
#
#  blink
#
blink: blink.c
	$(HOST_CC) -o $@ $@.c -I../../include -I$(ROOT)/host_include
#
#  Example of how to use tab2wvs
#
driver.v:  test_tab2vmem.tab tab2vmem
	./tab2vmem -o test.vmem test_tab2vmem.tab > driver.v

#
#  Test tab2sim
#
test_tab2sim:  tab2sim test_tab2sim.tab test1_tab2sim.tab test2_tab2sim.tab \
		test3_tab2sim.tab test4_tab2sim.tab test5_tab2sim.tab test6_tab2sim.tab \
               	test.0 test.1 test.2 test.3 test.4 test.5 test.6 test.7 \
               	test.0.out test.1.out test.2.out test.3.out test.4.out test.5.out \
		test.6.out test.7.out
	./tab2sim -o test.0a test_tab2sim.tab > test.0a.out
	diff test.0 test.0a
	diff test.0.out test.0a.out
	./tab2sim -o test.1a test1_tab2sim.tab > test.1a.out
	diff test.1 test.1a
	diff test.1.out test.1a.out
	./tab2sim -o test.2a test2_tab2sim.tab > test.2a.out
	diff test.2 test.2a
	diff test.2.out test.2a.out
	./tab2sim -o test.3a test3_tab2sim.tab > test.3a.out
	diff test.3 test.3a
	diff test.3.out test.3a.out
	./tab2sim -o test.4a test4_tab2sim.tab > test.4a.out
	diff test.4 test.4a
	diff test.4.out test.4a.out
	./tab2sim -o test.5a test5_tab2sim.tab > test.5a.out
	diff test.5 test.5a
	diff test.5.out test.5a.out
	./tab2sim -v -o test.6a test2_tab2sim.tab > test.6a.out
	diff test.6 test.6a
	diff test.6.out test.6a.out
	./tab2sim -v -o test.7a test6_tab2sim.tab > test.7a.out
	diff test.7 test.7a
	diff test.7.out test.7a.out
	rm test.*a.out test.*a

#
#  Tool for generating rdp primitive commands
#
setup:	setup.c

#
#  Tool for extracting a piece out of a binary file.
#
bincut:	bincut.c

#
#  Suffix rules
#
.SUFFIXES: .uu

.uu:
	uudecode $<
	chmod 775 $@