[libre-riscv-dev] [PATCH] Updating build scripts for installation

Daniel Benusovich flyingmonkeys1996 at gmail.com
Mon Oct 22 12:56:46 BST 2018


Did not realize that the attachment is not present here is the patch:

>From 74a914a8fbadd3da3e5896ade246202d75027832 Mon Sep 17 00:00:00 2001
From: Daniel Benusovich <flyingmonkeys1996 at gmail.com>
Date: Sun, 21 Oct 2018 20:12:23 -0700
Subject: [PATCH] Updating build scripts for installation

---
 id_regs.py        | 2 +-
 riscv/riscv.mk.in | 8 ++++----
 sv_proc_gen.py    | 5 +++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/id_regs.py b/id_regs.py
index 3bbd0b8..d993dc3 100644
--- a/id_regs.py
+++ b/id_regs.py
@@ -21,7 +21,7 @@
 import os
 import sys

-insns_dir = "./riscv/insns"
+insns_dir = "../riscv/insns"
 def list_insns():
     if len(sys.argv) == 2:
         fullfname = sys.argv[1]
diff --git a/riscv/riscv.mk.in b/riscv/riscv.mk.in
index 9226eff..17386c8 100644
--- a/riscv/riscv.mk.in
+++ b/riscv/riscv.mk.in
@@ -302,7 +302,7 @@ riscv_gen_srcs = \
 icache_entries := `grep "ICACHE_ENTRIES =" $(src_dir)/riscv/mmu.h | sed
's/.* = \(.*\);/\1/'`

 icache.h: mmu.h
- $(src_dir)/riscv/gen_icache $(icache_entries) > $@.tmp
+ ../riscv/gen_icache $(icache_entries) > $@.tmp
  mv $@.tmp $@

 insn_list.h: $(src_dir)/riscv/riscv.mk.in
@@ -310,11 +310,11 @@ insn_list.h: $(src_dir)/riscv/riscv.mk.in
  printf 'DEFINE_INSN(%s)\n' "$${insn}" ; \
  done > $@.tmp
  mv $@.tmp $@
- python sv_proc_gen.py
+ python ../sv_proc_gen.py

 $(riscv_gen_srcs): %.cc: insns/%.h insn_template.cc
- sed 's/NAME/$(subst .cc,,$@)/' $(src_dir)/riscv/insn_template.cc | sed
's/OPCODE/$(call get_opcode,$(src_dir)/riscv/encoding.h,$(subst .cc,,$@))/'
> $@
- python id_regs.py $(src_dir)/riscv/insns/$(subst .cc,,$@).h
+ sed 's/NAME/$(subst .cc,,$@)/' ../riscv/insn_template.cc | sed
's/OPCODE/$(call get_opcode,../riscv/encoding.h,$(subst .cc,,$@))/' > $@
+ python ../id_regs.py ../riscv/insns/$(subst .cc,,$@).h

 riscv_junk = \
  $(riscv_gen_srcs) \
diff --git a/sv_proc_gen.py b/sv_proc_gen.py
index 13eddaf..fcac680 100644
--- a/sv_proc_gen.py
+++ b/sv_proc_gen.py
@@ -21,7 +21,8 @@
 import os
 import sys

-insns_dir = "./riscv/insns"
+insns_dir = "../riscv/insns"
+insn_decl = "../riscv/sv_insn_decl.h"
 def list_insns():
     if len(sys.argv) == 2:
         fullfname = sys.argv[1]
@@ -46,7 +47,7 @@ sv_hdr_template = """\

 if __name__ == '__main__':
     files = list_insns()
-    with open("riscv/sv_insn_decl.h", "w") as f:
+    with open(insn_decl, "w") as f:
         for (fname, insn) in files:
             f.write(sv_hdr_template.format(insn))

-- 
2.17.1


More information about the libre-riscv-dev mailing list