From 9baf36f0d4c746cbd44a38199c1e765f301f5fa2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2021 16:00:01 +0800 Subject: [PATCH 1/3] modify the pre macro definition in sysmap.h according to the smart testbench --- C906_RTL_FACTORY/gen_rtl/mmu/rtl/sysmap.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/C906_RTL_FACTORY/gen_rtl/mmu/rtl/sysmap.h b/C906_RTL_FACTORY/gen_rtl/mmu/rtl/sysmap.h index 0db81f3..bfdf432 100644 --- a/C906_RTL_FACTORY/gen_rtl/mmu/rtl/sysmap.h +++ b/C906_RTL_FACTORY/gen_rtl/mmu/rtl/sysmap.h @@ -16,26 +16,26 @@ limitations under the License. // ADDR is 28-bit, 4K address // Flag includes: Strong Order, Cacheable, Bufferable, Shareable, Security - `define SYSMAP_BASE_ADDR0 28'h8ffff + `define SYSMAP_BASE_ADDR0 28'h01000 `define SYSMAP_FLG0 5'b01111 - `define SYSMAP_BASE_ADDR1 28'hbffff + `define SYSMAP_BASE_ADDR1 28'h02000 `define SYSMAP_FLG1 5'b10011 - `define SYSMAP_BASE_ADDR2 28'hcffff - `define SYSMAP_FLG2 5'b00011 + `define SYSMAP_BASE_ADDR2 28'hd0000 + `define SYSMAP_FLG2 5'b10011 `define SYSMAP_BASE_ADDR3 28'heffff - `define SYSMAP_FLG3 5'b01101 + `define SYSMAP_FLG3 5'b01111 `define SYSMAP_BASE_ADDR4 28'hfffff `define SYSMAP_FLG4 5'b01111 - `define SYSMAP_BASE_ADDR5 28'h3ffffff + `define SYSMAP_BASE_ADDR5 28'h4000000 `define SYSMAP_FLG5 5'b01111 - `define SYSMAP_BASE_ADDR6 28'h4ffffff - `define SYSMAP_FLG6 5'b10010 + `define SYSMAP_BASE_ADDR6 28'h5000000 + `define SYSMAP_FLG6 5'b10011 `define SYSMAP_BASE_ADDR7 28'hfffffff `define SYSMAP_FLG7 5'b01111 From f8013e4fa5f48eb8dee2736f5b4522015d50bc0c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2021 16:01:42 +0800 Subject: [PATCH 2/3] remove the redefine of printf function under tests/lib/clib dir --- smart_run/tests/lib/clib/printf.c | 43 ------------------------------- smart_run/tests/lib/clib/printf.h | 20 -------------- 2 files changed, 63 deletions(-) delete mode 100644 smart_run/tests/lib/clib/printf.c delete mode 100644 smart_run/tests/lib/clib/printf.h diff --git a/smart_run/tests/lib/clib/printf.c b/smart_run/tests/lib/clib/printf.c deleted file mode 100644 index cd9117a..0000000 --- a/smart_run/tests/lib/clib/printf.c +++ /dev/null @@ -1,43 +0,0 @@ -/*Copyright 2020-2021 T-Head Semiconductor Co., Ltd. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -#include "stdio.h" -#include "uart.h" - -//extern t_ck_uart_device uart0; -////t_ck_uart_device uart0; -//// -//int fputc(int ch, FILE *stream) -//{ -// return(ck_uart_putc(&uart0, ch)); -//} - -//int fputc(int ch, FILE *stream) { -//// int a = ch; -// asm("subi sp, 4 \n" -// "st.w r13, (sp, 0) \n" -// "lrw r13, 0x6000fff8 \n" -// "st.b %0, (r13, 0) \n" -//// "\n" -// "ld.w r13, (sp, 0) \n" -// "addi sp, 4 \n" -// : :"r"(ch)); -// return ch; -//} - -#define write_char(x) asm("lrw r13, 0x6000fff8; st.w %0, (r13, 0)" : :"r" (x) ) -int fputc(int ch, FILE *stream) { - write_char(ch); - return ch; -} diff --git a/smart_run/tests/lib/clib/printf.h b/smart_run/tests/lib/clib/printf.h deleted file mode 100644 index 3d313b8..0000000 --- a/smart_run/tests/lib/clib/printf.h +++ /dev/null @@ -1,20 +0,0 @@ -/*Copyright 2020-2021 T-Head Semiconductor Co., Ltd. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -#ifndef __PRINT_H -#define __PRINT_H -int printf(const char* fmt, ...); -static void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list ap); -#endif - From f5e836372fbfe4f96f61b133d614aaf2e12ee717 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2021 16:03:29 +0800 Subject: [PATCH 3/3] match two addresses in fputc.c and tb.v --- smart_run/tests/lib/clib/fputc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smart_run/tests/lib/clib/fputc.c b/smart_run/tests/lib/clib/fputc.c index 7429461..3a4a81d 100644 --- a/smart_run/tests/lib/clib/fputc.c +++ b/smart_run/tests/lib/clib/fputc.c @@ -16,7 +16,7 @@ limitations under the License. int fputc(int ch, FILE *stream) { asm( - "li x13, 0x6000fff8 \n\t" + "li x13, 0x10015000 \n\t" "sw %0, 0(x13) \n\t" : :"r" (ch): "x13" ); }