1 # -----------------------------------------------------------------------
3 # Copyright 2004,2007,2010 Tommy Thorn - All Rights Reserved
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 # Bostom MA 02111-1307, USA; either version 2 of the License, or
9 # (at your option) any later version; incorporated herein by reference.
11 # -----------------------------------------------------------------------
15 include ..
/shared
/shared.mk
17 YARISRC
:=yari.v stage_I.v stage_D.v stage_X.v stage_M.v
19 SYSTEMSRC
:=pipeconnect.v \
20 bus_ctrl.v sram_ctrl.v \
23 peri_ctrl.v rs232.v rs232out.v rs232in.v
25 PRIMSRC
:=simpledpram.v dpram.v
27 # Target logic that we model
31 arithshiftbidir.v logshiftright.v
33 # Change IDT_SRAM_MODEL to point to the IDT SRAM model if one is available
36 SRC
:=$(patsubst %,..
/..
/shared
/rtl
/yari-core
/%,$(YARISRC
)) \
37 $(patsubst %,..
/..
/shared
/rtl
/soclib
/%,$(SYSTEMSRC
)) \
42 IVERILOGOPTS
=-Wall
-g2005
-I..
/..
/shared
/rtl
/soclib
-I..
/..
/shared
/rtl
/yari-core
46 simulate
: $(patsubst %,rtl
/%,$(SRC
)) rtl
/config.h Makefile rtl
/icache_ram0.data
47 cd rtl
; iverilog
-o main.
test \
49 -DSIMULATE_MAIN
-DTRACE_SERIAL
-DSRAM_INIT
=$(SRAM_INIT
) $(SRC
)
52 rtl
/icache_ram0.data
: tinymon.mips
$(YARISIM
)
53 cd rtl
; ..
/$(YARISIM
) \
55 --icache-way
=$(IC_LINE_INDEX_BITS
) \
56 --icache-words
=$(IC_WORD_INDEX_BITS
) \
57 --dcache-way
=$(DC_LINE_INDEX_BITS
) \
58 --dcache-words
=$(DC_WORD_INDEX_BITS
) \
62 iverilog mult.v
-o mult.
test
65 testpipe
: ..
/shared
/rtl
/soclib
/pipeconnect.v
66 iverilog
-I .. ..
/shared
/rtl
/soclib
/pipeconnect.v testpipe.v
-o testpipe.
test
69 testpipe2
: ..
/shared
/rtl
/soclib
/pipeconnect.v
70 iverilog
-I .. ..
/shared
/rtl
/soclib
/pipeconnect.v testpipe2.v
-o testpipe2.
test
73 testpipe3
: ..
/shared
/rtl
/soclib
/pipeconnect.v
74 iverilog
-I .. ..
/shared
/rtl
/soclib
/pipeconnect.v testpipe3.v
-o testpipe3.
test
78 stage_I.
test: ..
/shared
/rtl
/yari-core
/stage_I.v coderom.v
79 iverilog
-DSIMULATE ..
/shared
/rtl
/yari-core
/stage_I.v coderom.v
-o stage_I.
test
82 stage_D.
test: stage_D.v coderom.v
83 iverilog
-DSIMULATE stage_D.v coderom.v
-o stage_D.
test
87 cp ..
/shared
/rtl
/..
/testcases
/tests.data initmem.data
91 iverilog
-DSIMULATE rs232out.v
-o rs232out
94 pipeline1
: pipeline1.v
95 iverilog pipeline1.v
-o pipeline1
101 -rm *~
*.data
*.txt a.out
103 tinymon.mips-o
: tinymon.c
104 mips-elf-gcc
-D_mips_
-msoft-float
-c
-Os
$< -o
$@
106 tinymon.mips
: tinymon.mips-o
107 mips-elf-ld
-Tprom.
ld $< -o
$@