OpenCores
URL https://opencores.org/ocsvn/yifive/yifive/trunk

Subversion Repositories yifive

[/] [yifive/] [trunk/] [caravel_yifive/] [verilog/] [dv/] [la_test1/] [Makefile] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dinesha
# SPDX-FileCopyrightText: 2020 Efabless Corporation
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#      http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
#
15
# SPDX-License-Identifier: Apache-2.0
16
 
17
## Caravel Pointers
18
CARAVEL_ROOT ?= ../../../caravel
19
CARAVEL_PATH ?= $(CARAVEL_ROOT)
20
CARAVEL_FIRMWARE_PATH = $(CARAVEL_PATH)/verilog/dv/caravel
21
CARAVEL_VERILOG_PATH  = $(CARAVEL_PATH)/verilog
22
CARAVEL_RTL_PATH = $(CARAVEL_VERILOG_PATH)/rtl
23
CARAVEL_BEHAVIOURAL_MODELS = $(CARAVEL_VERILOG_PATH)/dv/caravel
24
 
25
## User Project Pointers
26
UPRJ_VERILOG_PATH ?= ../../../verilog
27
UPRJ_RTL_PATH = $(UPRJ_VERILOG_PATH)/rtl
28
UPRJ_BEHAVIOURAL_MODELS = ../
29
 
30
## RISCV GCC
31
GCC_PATH?=/ef/apps/bin
32
GCC_PREFIX?=riscv32-unknown-elf
33
PDK_PATH?=/ef/tech/SW/sky130A
34
 
35
## Simulation mode: RTL/GL
36
SIM?=RTL
37
 
38
.SUFFIXES:
39
 
40
PATTERN = la_test1
41
 
42
all:  ${PATTERN:=.vcd}
43
 
44
hex:  ${PATTERN:=.hex}
45
 
46
%.vvp: %_tb.v %.hex
47
ifeq ($(SIM),RTL)
48
        iverilog -DFUNCTIONAL -DSIM -I $(PDK_PATH) \
49
        -I $(CARAVEL_BEHAVIOURAL_MODELS) -I $(CARAVEL_RTL_PATH) \
50
        -I $(UPRJ_BEHAVIOURAL_MODELS)    -I $(UPRJ_RTL_PATH) \
51
        $< -o $@
52
else
53
        iverilog -DFUNCTIONAL -DSIM -DGL -I $(PDK_PATH) \
54
        -I $(CARAVEL_BEHAVIOURAL_MODELS) -I $(CARAVEL_RTL_PATH) -I $(CARAVEL_VERILOG_PATH) \
55
        -I $(UPRJ_BEHAVIOURAL_MODELS) -I$(UPRJ_RTL_PATH)   -I $(UPRJ_VERILOG_PATH) \
56
        $< -o $@
57
endif
58
 
59
%.vcd: %.vvp
60
        vvp $<
61
 
62
%.elf: %.c $(CARAVEL_FIRMWARE_PATH)/sections.lds $(CARAVEL_FIRMWARE_PATH)/start.s
63
        ${GCC_PATH}/${GCC_PREFIX}-gcc -I $(CARAVEL_PATH) -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(CARAVEL_FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(CARAVEL_FIRMWARE_PATH)/start.s $<
64
 
65
%.hex: %.elf
66
        ${GCC_PATH}/${GCC_PREFIX}-objcopy -O verilog $< $@
67
        # to fix flash base address
68
        sed -i 's/@10000000/@00000000/g' $@
69
 
70
%.bin: %.elf
71
        ${GCC_PATH}/${GCC_PREFIX}-objcopy -O binary $< /dev/stdout | tail -c +1048577 > $@
72
 
73
# ---- Clean ----
74
 
75
clean:
76
        rm -f *.elf *.hex *.bin *.vvp *.vcd *.log
77
 
78
.PHONY: clean hex all

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.