Browse Source

Add Makefile for synthesis of CBCTDES

T. Meissner 1 month ago
parent
commit
e3e993fe4b
1 changed files with 49 additions and 0 deletions
  1. 49
    0
      cbctdes/syn/vhdl/Makefile

+ 49
- 0
cbctdes/syn/vhdl/Makefile View File

@@ -0,0 +1,49 @@
1
+# ======================================================================
2
+# CBC-TDES encryption/decryption
3
+# algorithm according to FIPS 46-3 specification
4
+# Copyright (C) 2020 Torsten Meissner
5
+#-----------------------------------------------------------------------
6
+# This program is free software; you can redistribute it and/or modify
7
+# it under the terms of the GNU General Public License as published by
8
+# the Free Software Foundation; either version 2 of the License, or
9
+# (at your option) any later version.
10
+
11
+# This program is distributed in the hope that it will be useful,
12
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+# GNU General Public License for more details.
15
+
16
+# You should have received a copy of the GNU General Public License
17
+# along with this program; if not, write to the Free Software
18
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
+# ======================================================================
20
+
21
+
22
+DESIGN_NAME := cbctdes
23
+SRC_FILES   := ../../../des/rtl/vhdl/des_pkg.vhd \
24
+               ../../../des/rtl/vhdl/des.vhd \
25
+               ../../../tdes/rtl/vhdl/tdes.vhd \
26
+               ../../rtl/vhdl/$(DESIGN_NAME).vhd
27
+VHD_STD     := 08
28
+
29
+
30
+.PHONY: all
31
+all : $(DESIGN_NAME)_synth.vhd syn
32
+
33
+.PHONY: syn
34
+syn: $(DESIGN_NAME).json
35
+
36
+
37
+$(DESIGN_NAME).o: $(SRC_FILES)
38
+	ghdl -a --std=$(VHD_STD) $(SRC_FILES)
39
+
40
+$(DESIGN_NAME)_synth.vhd: $(SRC_FILES)
41
+	ghdl --synth --std=$(VHD_STD) $(SRC_FILES) -e $(DESIGN_NAME) > $@
42
+
43
+$(DESIGN_NAME).json: $(DESIGN_NAME).o
44
+	yosys -m ghdl -p 'ghdl --std=$(VHD_STD) --no-formal $(DESIGN_NAME); synth_ice40 -json $@'
45
+
46
+
47
+clean :
48
+	echo "# Cleaning files"
49
+	rm -f *.o work*.cf $(DESIGN_NAME).json $(DESIGN_NAME)_synth.vhd