Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
饶先宏
hdl4se
提交
5f3252a2
H
hdl4se
项目概览
饶先宏
/
hdl4se
通知
12
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hdl4se
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5f3252a2
编写于
9月 03, 2021
作者:
饶先宏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
202109032123 增加了软件中的w, r读写命令
上级
187d2bd8
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
6868 addition
and
6618 deletion
+6868
-6618
examples/hdl4se_riscv/de2/de2_riscv_v4.qws
examples/hdl4se_riscv/de2/de2_riscv_v4.qws
+0
-0
examples/hdl4se_riscv/de2/de2_riscv_v4.sof
examples/hdl4se_riscv/de2/de2_riscv_v4.sof
+0
-0
examples/hdl4se_riscv/de2/de2_riscv_v4.v
examples/hdl4se_riscv/de2/de2_riscv_v4.v
+18
-8
examples/hdl4se_riscv/test_code/console.c
examples/hdl4se_riscv/test_code/console.c
+101
-34
examples/hdl4se_riscv/test_code/console.sh
examples/hdl4se_riscv/test_code/console.sh
+1
-1
examples/hdl4se_riscv/test_code/test.cod
examples/hdl4se_riscv/test_code/test.cod
+473
-445
examples/hdl4se_riscv/test_code/test.elf
examples/hdl4se_riscv/test_code/test.elf
+0
-0
examples/hdl4se_riscv/test_code/test.hex
examples/hdl4se_riscv/test_code/test.hex
+562
-534
examples/hdl4se_riscv/test_code/test.info
examples/hdl4se_riscv/test_code/test.info
+104
-107
examples/hdl4se_riscv/test_code/test.mif
examples/hdl4se_riscv/test_code/test.mif
+2451
-2451
examples/hdl4se_riscv/test_code/test.txt
examples/hdl4se_riscv/test_code/test.txt
+3156
-3036
examples/hdl4se_riscv/verilog/riscv_core_v4.v
examples/hdl4se_riscv/verilog/riscv_core_v4.v
+2
-2
未找到文件。
examples/hdl4se_riscv/de2/de2_riscv_v4.qws
0 → 100644
浏览文件 @
5f3252a2
文件已添加
examples/hdl4se_riscv/de2/de2_riscv_v4.sof
浏览文件 @
5f3252a2
无法预览此类型文件
examples/hdl4se_riscv/de2/de2_riscv_v4.v
浏览文件 @
5f3252a2
...
...
@@ -513,14 +513,24 @@ inout [35:0] GPIO;
led5
<=
8'h6d
;
end
else
if
(
wWrite
&&
((
bWriteAddr
&
32'hffffff00
)
==
32'hf0000000
))
begin
if
(
bWriteAddr
[
7
:
0
]
==
8'h10
)
begin
led0
<=
bWriteData
[
6
:
0
];
led1
<=
bWriteData
[
14
:
8
];
led2
<=
bWriteData
[
22
:
16
];
led3
<=
bWriteData
[
30
:
24
];
end
else
if
(
bWriteAddr
[
7
:
0
]
==
8'h14
)
begin
led4
<=
bWriteData
[
6
:
0
];
led5
<=
bWriteData
[
14
:
8
];
if
(
bWriteAddr
[
3
:
2
]
==
2'h0
)
begin
if
(
bWriteMask
[
0
]
==
0
)
led0
<=
bWriteData
[
6
:
0
];
if
(
bWriteMask
[
1
]
==
0
)
led1
<=
bWriteData
[
14
:
8
];
if
(
bWriteMask
[
2
]
==
0
)
led2
<=
bWriteData
[
22
:
16
];
if
(
bWriteMask
[
3
]
==
0
)
led3
<=
bWriteData
[
30
:
24
];
end
else
if
(
bWriteAddr
[
3
:
2
]
==
2'h1
)
begin
if
(
bWriteMask
[
0
]
==
0
)
led4
<=
bWriteData
[
6
:
0
];
if
(
bWriteMask
[
1
]
==
0
)
led5
<=
bWriteData
[
14
:
8
];
if
(
bWriteMask
[
2
]
==
0
)
led6
<=
bWriteData
[
22
:
16
];
if
(
bWriteMask
[
3
]
==
0
)
led7
<=
bWriteData
[
30
:
24
];
end
end
end
...
...
examples/hdl4se_riscv/test_code/console.c
浏览文件 @
5f3252a2
...
...
@@ -2,8 +2,8 @@
#define UARTADDRESS (unsigned int *)0xf0000100
#define REFFREQ 50000000
volatile
unsigned
int
*
_uartaddr
=
UARTADDRESS
;
volatile
unsigned
int
_uartstate
;
static
volatile
unsigned
int
*
_uartaddr
=
UARTADDRESS
;
static
volatile
unsigned
int
_uartstate
;
/*
地址 0 -- 读接收数据
...
...
@@ -15,19 +15,19 @@ volatile unsigned int _uartstate;
[26:17] -- recv buffer used
*/
int
_canputchar
()
static
int
_canputchar
()
{
_uartstate
=
_uartaddr
[
2
];
return
((
_uartstate
&
1
)
==
0
);
}
int
_haschar
()
static
int
_haschar
()
{
_uartstate
=
_uartaddr
[
2
];
return
((
_uartstate
&
0x10000
)
==
0
);
}
int
_putchar
(
int
ch
)
static
int
_putchar
(
int
ch
)
{
_uartstate
=
_uartaddr
[
2
];
if
((
_uartstate
&
1
)
==
0
)
{
...
...
@@ -37,7 +37,7 @@ int _putchar(int ch)
return
-
1
;
}
int
_getchar
()
static
int
_getchar
()
{
_uartstate
=
_uartaddr
[
2
];
if
((
_uartstate
&
0x10000
)
==
0
)
{
...
...
@@ -46,7 +46,7 @@ int _getchar()
return
-
1
;
}
int
_puts
(
const
char
*
s
)
static
int
_puts
(
const
char
*
s
)
{
while
(
*
s
)
{
while
(
_putchar
(
*
s
)
==
-
1
)
...
...
@@ -56,7 +56,7 @@ int _puts(const char* s)
return
0
;
}
int
_gets
(
char
*
s
,
int
buflen
)
static
int
_gets
(
char
*
s
,
int
buflen
)
{
int
ind
,
ch
;
ind
=
0
;
...
...
@@ -65,7 +65,13 @@ int _gets(char* s, int buflen)
do
{
ch
=
_getchar
();
if
(
ch
!=
-
1
)
{
s
[
ind
++
]
=
ch
;
if
(
ch
==
'\b'
)
{
if
(
ind
>
0
)
ind
--
;
}
else
{
s
[
ind
++
]
=
ch
;
}
while
(
_putchar
(
ch
)
==
-
1
)
/* 回显 */
;
if
(
ind
>=
buflen
-
1
)
...
...
@@ -78,7 +84,7 @@ int _gets(char* s, int buflen)
return
ind
;
}
int
_d2s
(
char
*
buf
,
int
num
)
static
int
_d2s
(
char
*
buf
,
int
num
)
{
int
i
;
int
len
;
...
...
@@ -106,7 +112,7 @@ int _d2s(char* buf, int num)
return
len
;
}
int
_h2s
(
char
*
buf
,
unsigned
long
long
num
,
int
fixlen
,
char
lead
)
static
int
_h2s
(
char
*
buf
,
unsigned
long
long
num
,
int
fixlen
,
char
lead
)
{
int
i
;
int
len
;
...
...
@@ -134,7 +140,7 @@ int _h2s(char* buf, unsigned long long num, int fixlen, char lead)
return
len
;
}
int
_s2d
(
const
char
*
buf
,
const
char
**
next
)
static
int
_s2d
(
char
*
buf
,
char
**
next
)
{
int
state
;
int
ret
;
...
...
@@ -169,7 +175,7 @@ int _s2d(const char* buf, const char** next)
return
ret
;
}
int
_s2h
(
const
char
*
buf
,
const
char
**
next
)
static
int
_s2h
(
char
*
buf
,
char
**
next
)
{
int
state
;
int
ret
;
...
...
@@ -204,7 +210,7 @@ int _s2h(const char* buf, const char** next)
return
ret
;
}
int
_strlen
(
const
char
*
s
)
static
int
_strlen
(
const
char
*
s
)
{
const
char
*
ss
;
ss
=
s
;
...
...
@@ -212,7 +218,7 @@ int _strlen(const char* s)
return
s
-
ss
;
}
int
_strcpy
(
char
*
s
,
const
char
*
t
)
static
int
_strcpy
(
char
*
s
,
const
char
*
t
)
{
char
*
ss
=
s
;
while
(
*
t
)
...
...
@@ -221,7 +227,7 @@ int _strcpy(char* s, const char* t)
return
s
-
ss
;
}
int
_strcat
(
char
*
s
,
const
char
*
t
)
static
int
_strcat
(
char
*
s
,
const
char
*
t
)
{
char
*
ss
=
s
;
while
(
*
s
)
...
...
@@ -232,7 +238,7 @@ int _strcat(char* s, const char* t)
return
s
-
ss
;
}
int
_strcmp
(
const
char
*
s
,
const
char
*
t
)
static
int
_strcmp
(
const
char
*
s
,
const
char
*
t
)
{
while
(
*
s
&&
*
t
)
{
if
(
*
s
++
!=
*
t
++
)
...
...
@@ -241,7 +247,7 @@ int _strcmp(const char* s, const char* t)
return
0
;
}
int
_strncmp
(
const
char
*
s
,
const
char
*
t
,
int
n
)
static
int
_strncmp
(
const
char
*
s
,
const
char
*
t
,
int
n
)
{
int
count
;
count
=
0
;
...
...
@@ -255,31 +261,31 @@ int _strncmp(const char* s, const char* t, int n)
return
0
;
}
int
_buadrateset
(
int
baud
)
static
int
_buadrateset
(
int
baud
)
{
_uartaddr
[
4
]
=
REFFREQ
/
baud
;
return
0
;
}
unsigned
int
displayaddr
=
0
;
void
dispmem
()
static
unsigned
int
displayaddr
=
0
;
static
void
dispmem
()
{
int
i
,
j
,
len
;
unsigned
int
startaddr
=
displayaddr
&
0xfffffff0
;
char
buf
[
256
];
for
(
j
=
0
;
j
<
16
;
j
++
)
{
_h2s
(
buf
,
startaddr
,
8
,
'0'
);
len
=
_strcat
(
buf
,
" "
);
_strcat
(
buf
,
" "
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
unsigned
char
*
disp
=
(
unsigned
char
*
)
startaddr
;
if
(
startaddr
+
i
<
displayaddr
)
{
len
=
_strcat
(
buf
,
" "
);
_strcat
(
buf
,
" "
);
}
else
{
char
temp
[
8
];
_h2s
(
temp
,
disp
[
i
],
2
,
'0'
);
_strcat
(
temp
,
" "
);
len
=
_strcat
(
buf
,
temp
);
_strcat
(
buf
,
temp
);
}
if
(
i
==
7
)
_strcat
(
buf
,
"- "
);
...
...
@@ -321,12 +327,12 @@ const unsigned int segcode[10] =
0x6f
,
// 8'b01101111,
};
unsigned
int
num2seg
(
unsigned
int
num
)
static
unsigned
int
num2seg
(
unsigned
int
num
)
{
return
segcode
[
num
%
10
];
}
unsigned
long
long
cycle
()
{
static
unsigned
long
long
cycle
()
{
unsigned
long
long
ret
;
unsigned
int
retl
,
reth
;
asm
volatile
(
...
...
@@ -341,7 +347,7 @@ unsigned long long cycle() {
return
ret
;
}
unsigned
long
long
instrcount
()
{
static
unsigned
long
long
instrcount
()
{
unsigned
long
long
ret
;
unsigned
int
retl
,
reth
;
asm
volatile
(
...
...
@@ -356,6 +362,14 @@ unsigned long long instrcount() {
return
ret
;
}
static
void
printhelp
()
{
_puts
(
" d <addr> -- display memory
\n
"
);
_puts
(
" b <baudrate> -- set baudrate
\n
"
);
_puts
(
" r <addr> <width>
\n
"
);
_puts
(
" w <addr> <value> <width>
\n
"
);
_puts
(
" width=1,2 or 4
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -416,11 +430,11 @@ int main(int argc, char* argv[])
ledd
[
11
]
=
num2seg
(
ctemp
/
1000
);
leddata
[
0
]
=
*
(
unsigned
int
*
)
&
ledd
[
0
];
leddata
[
1
]
=
*
(
unsigned
int
*
)
&
ledd
[
4
];
leddata
[
2
]
=
*
(
unsigned
int
*
)
&
ledd
[
8
];
//
leddata[1] = *(unsigned int*)&ledd[4];
//
leddata[2] = *(unsigned int*)&ledd[8];
}
else
{
unsigned
int
count
=
cycle
()
/
100
0
;
unsigned
int
count
=
cycle
()
>>
1
0
;
ledd
[
0
]
=
num2seg
(
count
);
ledd
[
1
]
=
num2seg
(
count1
/
10
);
...
...
@@ -431,23 +445,76 @@ int main(int argc, char* argv[])
}
while
(
1
);
_puts
(
":"
);
_puts
(
buf
);
_puts
(
"
\n\r
"
);
if
(
_strncmp
(
buf
,
"help "
,
4
)
==
0
)
{
_puts
(
" d <addr> -- display memory
\n
"
);
_puts
(
" b <baudrate> -- set baudrate
\n
"
);
printhelp
();
}
else
if
(
_strncmp
(
buf
,
"b"
,
1
)
==
0
)
{
else
if
(
buf
[
0
]
==
'b'
)
{
int
baud
=
_s2d
(
buf
+
2
,
0
);
if
(
baud
>
0
)
{
_buadrateset
(
baud
);
}
else
{
printhelp
();
}
}
else
if
(
_strncmp
(
buf
,
"d"
,
1
)
==
0
)
{
else
if
(
buf
[
0
]
==
'd'
)
{
int
addr
=
_s2h
(
buf
+
2
,
0
);
if
(
addr
>
0
)
{
displayaddr
=
addr
;
}
dispmem
();
}
else
if
(
buf
[
0
]
==
'w'
)
{
char
*
next
;
int
addr
=
_s2h
(
buf
+
2
,
&
next
);
int
value
=
_s2h
(
next
,
&
next
);
int
width
=
_s2h
(
next
,
&
next
);
if
(
width
==
1
)
{
*
(
char
*
)
addr
=
value
;
}
else
if
(
width
==
2
)
{
*
(
short
*
)
addr
=
value
;
}
else
if
(
width
==
4
)
{
*
(
int
*
)
addr
=
value
;
}
else
{
printhelp
();
}
}
else
if
(
buf
[
0
]
==
'r'
)
{
char
*
next
;
int
value
=
0
;
int
addr
=
_s2h
(
buf
+
2
,
&
next
);
int
width
=
_s2h
(
next
,
&
next
);
if
(
width
==
1
)
{
value
=
*
(
char
*
)
addr
;
_puts
(
"char @"
);
}
else
if
(
width
==
2
)
{
value
=
*
(
short
*
)
addr
;
_puts
(
"short @"
);
}
else
if
(
width
==
4
)
{
value
=
*
(
int
*
)
addr
;
_puts
(
"int @"
);
}
else
{
printhelp
();
}
if
(
width
==
1
||
width
==
2
||
width
==
4
)
{
_h2s
(
buf
,
addr
,
8
,
'0'
);
_puts
(
buf
);
_puts
(
" = "
);
_d2s
(
buf
,
value
);
_puts
(
buf
);
_puts
(
"("
);
_h2s
(
buf
,
value
,
width
*
2
,
'0'
);
_puts
(
buf
);
_puts
(
")
\n\r
"
);
}
}
}
while
(
1
);
return
1
;
}
examples/hdl4se_riscv/test_code/console.sh
浏览文件 @
5f3252a2
#!/bin/bash
riscv32-unknown-elf-gcc
-
Wl
,-Ttest.ld
console.c
-o
test.elf
riscv32-unknown-elf-gcc
-
ffunction-sections
-fdata-sections
-Wl
,-Ttest.ld
-Wl
,--gc-sections
console.c
-o
test.elf
riscv32-unknown-elf-objcopy test.elf
-O
ihex test.hex
riscv32-unknown-elf-objcopy test.elf
-O
verilog test.cod
riscv32-unknown-elf-objdump
-D
-M
no-aliases,numeric test.elf
>
test.txt
...
...
examples/hdl4se_riscv/test_code/test.cod
浏览文件 @
5f3252a2
此差异已折叠。
点击以展开。
examples/hdl4se_riscv/test_code/test.elf
浏览文件 @
5f3252a2
无法预览此类型文件
examples/hdl4se_riscv/test_code/test.hex
浏览文件 @
5f3252a2
此差异已折叠。
点击以展开。
examples/hdl4se_riscv/test_code/test.info
浏览文件 @
5f3252a2
...
...
@@ -10,7 +10,7 @@ ELF Header:
Version: 0x1
Entry point address: 0x8c
Start of program headers: 52 (bytes into file)
Start of section headers: 2044
4
(bytes into file)
Start of section headers: 2044
0
(bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
...
...
@@ -22,28 +22,28 @@ ELF Header:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 00000074 000074 001
c58
00 AX 0 0 4
[ 2] .rodata PROGBITS 00001
ccc 001ccc 0001bc
00 A 0 0 4
[ 3] .eh_frame PROGBITS 0000
2000 002000
00002c 00 WA 0 0 4
[ 4] .init_array INIT_ARRAY 0000
202c 00202c
000008 04 WA 0 0 4
[ 5] .fini_array FINI_ARRAY 0000
2034 002034
000004 04 WA 0 0 4
[ 6] .data PROGBITS 0000
2038 00203
8 000428 00 WA 0 0 8
[ 7] .sdata PROGBITS 0000
2460 002460 000010
00 WA 0 0 4
[ 8] .sbss NOBITS 0000
2470 002470
000008 00 WA 0 0 4
[ 9] .bss NOBITS 0000
2478 002470
00001c 00 WA 0 0 4
[10] .comment PROGBITS 00000000 0024
70
000012 01 MS 0 0 1
[11] .riscv.attributes RISCV_ATTRIBUTE 00000000 0024
82 00002a
00 0 0 1
[12] .debug_aranges PROGBITS 00000000 0024
ac
000038 00 0 0 1
[13] .debug_info PROGBITS 00000000 002
4e4
000839 00 0 0 1
[14] .debug_abbrev PROGBITS 00000000 002d
1d
000216 00 0 0 1
[15] .debug_line PROGBITS 00000000 002f
33
000766 00 0 0 1
[16] .debug_str PROGBITS 00000000 0036
99 00029a
01 MS 0 0 1
[17] .debug_line_str PROGBITS 00000000 0039
33 0000aa
01 MS 0 0 1
[18] .debug_loclists PROGBITS 00000000 003
9dd
000a99 00 0 0 1
[19] .debug_rnglists PROGBITS 00000000 0044
76
000111 00 0 0 1
[20] .symtab SYMTAB 00000000 0045
88 000620 10 21 51
4
[21] .strtab STRTAB 00000000 004b
a8 000344
00 0 0 1
[22] .shstrtab STRTAB 00000000 004ee
c
0000ee 00 0 0 1
[ 1] .text PROGBITS 00000074 000074 001
db0
00 AX 0 0 4
[ 2] .rodata PROGBITS 00001
e24 001e24 000228
00 A 0 0 4
[ 3] .eh_frame PROGBITS 0000
304c 00204c
00002c 00 WA 0 0 4
[ 4] .init_array INIT_ARRAY 0000
3078 002078
000008 04 WA 0 0 4
[ 5] .fini_array FINI_ARRAY 0000
3080 002080
000004 04 WA 0 0 4
[ 6] .data PROGBITS 0000
3088 00208
8 000428 00 WA 0 0 8
[ 7] .sdata PROGBITS 0000
34b0 0024b0 00000c
00 WA 0 0 4
[ 8] .sbss NOBITS 0000
34bc 0024bc
000008 00 WA 0 0 4
[ 9] .bss NOBITS 0000
34c4 0024bc
00001c 00 WA 0 0 4
[10] .comment PROGBITS 00000000 0024
bc
000012 01 MS 0 0 1
[11] .riscv.attributes RISCV_ATTRIBUTE 00000000 0024
ce 000025
00 0 0 1
[12] .debug_aranges PROGBITS 00000000 0024
f3
000038 00 0 0 1
[13] .debug_info PROGBITS 00000000 002
52b
000839 00 0 0 1
[14] .debug_abbrev PROGBITS 00000000 002d
64
000216 00 0 0 1
[15] .debug_line PROGBITS 00000000 002f
7a
000766 00 0 0 1
[16] .debug_str PROGBITS 00000000 0036
e0 000296
01 MS 0 0 1
[17] .debug_line_str PROGBITS 00000000 0039
76 0000b0
01 MS 0 0 1
[18] .debug_loclists PROGBITS 00000000 003
a26
000a99 00 0 0 1
[19] .debug_rnglists PROGBITS 00000000 0044
bf
000111 00 0 0 1
[20] .symtab SYMTAB 00000000 0045
d0 0005f0 10 21 72
4
[21] .strtab STRTAB 00000000 004b
c0 000329
00 0 0 1
[22] .shstrtab STRTAB 00000000 004ee
9
0000ee 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
...
...
@@ -54,8 +54,8 @@ There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x0
1e88 0x01e88
R E 0x1000
LOAD 0x0020
00 0x00002000 0x00002000
0x00470 0x00494 RW 0x1000
LOAD 0x000000 0x00000000 0x00000000 0x0
204c 0x0204c
R E 0x1000
LOAD 0x0020
4c 0x0000304c 0x0000304c
0x00470 0x00494 RW 0x1000
Section to Segment mapping:
Segment Sections...
...
...
@@ -68,18 +68,18 @@ There are no relocations in this file.
The decoding of unwind sections for machine type RISC-V is not currently supported.
Symbol table '.symtab' contains 9
8
entries:
Symbol table '.symtab' contains 9
5
entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000074 0 SECTION LOCAL DEFAULT 1 .text
2: 00001
ccc
0 SECTION LOCAL DEFAULT 2 .rodata
3: 0000
2000
0 SECTION LOCAL DEFAULT 3 .eh_frame
4: 0000
202c
0 SECTION LOCAL DEFAULT 4 .init_array
5: 0000
2034
0 SECTION LOCAL DEFAULT 5 .fini_array
6: 0000
203
8 0 SECTION LOCAL DEFAULT 6 .data
7: 0000
246
0 0 SECTION LOCAL DEFAULT 7 .sdata
8: 0000
2470
0 SECTION LOCAL DEFAULT 8 .sbss
9: 0000
2478
0 SECTION LOCAL DEFAULT 9 .bss
2: 00001
e24
0 SECTION LOCAL DEFAULT 2 .rodata
3: 0000
304c
0 SECTION LOCAL DEFAULT 3 .eh_frame
4: 0000
3078
0 SECTION LOCAL DEFAULT 4 .init_array
5: 0000
3080
0 SECTION LOCAL DEFAULT 5 .fini_array
6: 0000
308
8 0 SECTION LOCAL DEFAULT 6 .data
7: 0000
34b
0 0 SECTION LOCAL DEFAULT 7 .sdata
8: 0000
34bc
0 SECTION LOCAL DEFAULT 8 .sbss
9: 0000
34c4
0 SECTION LOCAL DEFAULT 9 .bss
10: 00000000 0 SECTION LOCAL DEFAULT 10 .comment
11: 00000000 0 SECTION LOCAL DEFAULT 11 .riscv.attributes
12: 00000000 0 SECTION LOCAL DEFAULT 12 .debug_aranges
...
...
@@ -93,86 +93,83 @@ Symbol table '.symtab' contains 98 entries:
20: 00000000 0 FILE LOCAL DEFAULT ABS __call_atexit.c
21: 00000074 24 FUNC LOCAL DEFAULT 1 register_fini
22: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
23: 0000
2000
0 OBJECT LOCAL DEFAULT 3 __EH_FRAME_BEGIN__
23: 0000
304c
0 OBJECT LOCAL DEFAULT 3 __EH_FRAME_BEGIN__
24: 000000d8 0 FUNC LOCAL DEFAULT 1 __do_global_dtors_aux
25: 0000
2478
1 OBJECT LOCAL DEFAULT 9 completed.1
26: 0000
2034
0 OBJECT LOCAL DEFAULT 5 __do_global_dtor[...]
25: 0000
34c4
1 OBJECT LOCAL DEFAULT 9 completed.1
26: 0000
3080
0 OBJECT LOCAL DEFAULT 5 __do_global_dtor[...]
27: 0000011c 0 FUNC LOCAL DEFAULT 1 frame_dummy
28: 0000
247c
24 OBJECT LOCAL DEFAULT 9 object.0
29: 0000
2030
0 OBJECT LOCAL DEFAULT 4 __frame_dummy_in[...]
28: 0000
34c8
24 OBJECT LOCAL DEFAULT 9 object.0
29: 0000
307c
0 OBJECT LOCAL DEFAULT 4 __frame_dummy_in[...]
30: 00000000 0 FILE LOCAL DEFAULT ABS console.c
31: 00000000 0 FILE LOCAL DEFAULT ABS libgcc2.c
32: 00000000 0 FILE LOCAL DEFAULT ABS libgcc2.c
33: 00000000 0 FILE LOCAL DEFAULT ABS exit.c
34: 00000000 0 FILE LOCAL DEFAULT ABS impure.c
35: 00002038 1064 OBJECT LOCAL DEFAULT 6 impure_data
36: 00000000 0 FILE LOCAL DEFAULT ABS init.c
37: 00000000 0 FILE LOCAL DEFAULT ABS fini.c
38: 00000000 0 FILE LOCAL DEFAULT ABS atexit.c
39: 00000000 0 FILE LOCAL DEFAULT ABS __atexit.c
40: 00000000 0 FILE LOCAL DEFAULT ABS sys_exit.c
41: 00000000 0 FILE LOCAL DEFAULT ABS errno.c
42: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
43: 00002028 0 OBJECT LOCAL DEFAULT 3 __FRAME_END__
44: 00000000 0 FILE LOCAL DEFAULT ABS
45: 00002038 0 NOTYPE LOCAL DEFAULT 5 __fini_array_end
46: 00002034 0 NOTYPE LOCAL DEFAULT 5 __fini_array_start
47: 00002034 0 NOTYPE LOCAL DEFAULT 4 __init_array_end
48: 0000202c 0 NOTYPE LOCAL DEFAULT 4 __preinit_array_end
49: 0000202c 0 NOTYPE LOCAL DEFAULT 4 __init_array_start
50: 0000202c 0 NOTYPE LOCAL DEFAULT 4 __preinit_array_start
51: 000001b8 88 FUNC GLOBAL DEFAULT 1 _putchar
52: 00000e28 124 FUNC GLOBAL DEFAULT 1 cycle
53: 00000994 140 FUNC GLOBAL DEFAULT 1 _strcat
54: 00002838 0 NOTYPE GLOBAL DEFAULT ABS __global_pointer$
55: 00000a20 112 FUNC GLOBAL DEFAULT 1 _strcmp
56: 00001ce8 40 OBJECT GLOBAL DEFAULT 2 segcode
57: 00001cc4 8 FUNC GLOBAL DEFAULT 1 __errno
58: 00002460 0 NOTYPE GLOBAL DEFAULT 7 __SDATA_BEGIN__
59: 0000013c 60 FUNC GLOBAL DEFAULT 1 _canputchar
60: 0000079c 312 FUNC GLOBAL DEFAULT 1 _s2h
61: 0000025c 104 FUNC GLOBAL DEFAULT 1 _puts
62: 00000b28 64 FUNC GLOBAL DEFAULT 1 _buadrateset
63: 000004f8 424 FUNC GLOBAL DEFAULT 1 _h2s
64: 00002464 0 OBJECT GLOBAL HIDDEN 7 __dso_handle
65: 00000b68 640 FUNC GLOBAL DEFAULT 1 dispmem
66: 00000178 64 FUNC GLOBAL DEFAULT 1 _haschar
67: 00002460 4 OBJECT GLOBAL DEFAULT 7 _global_impure_ptr
68: 000018f4 156 FUNC GLOBAL DEFAULT 1 __libc_init_array
69: 00001494 1072 FUNC GLOBAL HIDDEN 1 __udivdi3
70: 000002c4 216 FUNC GLOBAL DEFAULT 1 _gets
71: 00001b8c 92 FUNC GLOBAL DEFAULT 1 __libc_fini_array
72: 000006a0 252 FUNC GLOBAL DEFAULT 1 _s2d
73: 00001a6c 288 FUNC GLOBAL DEFAULT 1 __call_exitprocs
74: 0000008c 76 FUNC GLOBAL DEFAULT 1 _start
75: 00001bfc 152 FUNC GLOBAL DEFAULT 1 __register_exitproc
76: 00000210 76 FUNC GLOBAL DEFAULT 1 _getchar
77: 00002494 0 NOTYPE GLOBAL DEFAULT 9 __BSS_END__
78: 00002468 4 OBJECT GLOBAL DEFAULT 7 _uartaddr
79: 0000039c 348 FUNC GLOBAL DEFAULT 1 _d2s
80: 00002470 0 NOTYPE GLOBAL DEFAULT 8 __bss_start
81: 00001990 220 FUNC GLOBAL DEFAULT 1 memset
82: 00000f20 1396 FUNC GLOBAL DEFAULT 1 main
83: 00002474 4 OBJECT GLOBAL DEFAULT 8 displayaddr
84: 00000924 112 FUNC GLOBAL DEFAULT 1 _strcpy
85: 00001d88 256 OBJECT GLOBAL HIDDEN 2 __clz_tab
86: 00001be8 20 FUNC GLOBAL DEFAULT 1 atexit
87: 0000246c 4 OBJECT GLOBAL DEFAULT 7 _impure_ptr
88: 00002038 0 NOTYPE GLOBAL DEFAULT 6 __DATA_BEGIN__
89: 00000a90 152 FUNC GLOBAL DEFAULT 1 _strncmp
90: 00000de8 64 FUNC GLOBAL DEFAULT 1 num2seg
91: 00002470 4 OBJECT GLOBAL DEFAULT 8 _uartstate
92: 00002470 0 NOTYPE GLOBAL DEFAULT 7 _edata
93: 00002494 0 NOTYPE GLOBAL DEFAULT 9 _end
94: 000018c4 48 FUNC GLOBAL DEFAULT 1 exit
95: 000008d4 80 FUNC GLOBAL DEFAULT 1 _strlen
96: 00001c94 48 FUNC GLOBAL DEFAULT 1 _exit
97: 00000ea4 124 FUNC GLOBAL DEFAULT 1 instrcount
31: 000034b4 4 OBJECT LOCAL DEFAULT 7 _uartaddr
32: 000034bc 4 OBJECT LOCAL DEFAULT 8 _uartstate
33: 0000013c 60 FUNC LOCAL DEFAULT 1 _canputchar
34: 00000178 64 FUNC LOCAL DEFAULT 1 _haschar
35: 000001b8 88 FUNC LOCAL DEFAULT 1 _putchar
36: 00000210 76 FUNC LOCAL DEFAULT 1 _getchar
37: 0000025c 104 FUNC LOCAL DEFAULT 1 _puts
38: 000002c4 252 FUNC LOCAL DEFAULT 1 _gets
39: 000003c0 348 FUNC LOCAL DEFAULT 1 _d2s
40: 0000051c 424 FUNC LOCAL DEFAULT 1 _h2s
41: 000006c4 252 FUNC LOCAL DEFAULT 1 _s2d
42: 000007c0 312 FUNC LOCAL DEFAULT 1 _s2h
43: 000008f8 140 FUNC LOCAL DEFAULT 1 _strcat
44: 00000984 152 FUNC LOCAL DEFAULT 1 _strncmp
45: 00000a1c 64 FUNC LOCAL DEFAULT 1 _buadrateset
46: 000034c0 4 OBJECT LOCAL DEFAULT 8 displayaddr
47: 00000a5c 628 FUNC LOCAL DEFAULT 1 dispmem
48: 00000cd0 64 FUNC LOCAL DEFAULT 1 num2seg
49: 00000d10 124 FUNC LOCAL DEFAULT 1 cycle
50: 00000d8c 124 FUNC LOCAL DEFAULT 1 instrcount
51: 00000e08 96 FUNC LOCAL DEFAULT 1 printhelp
52: 00000000 0 FILE LOCAL DEFAULT ABS libgcc2.c
53: 00000000 0 FILE LOCAL DEFAULT ABS exit.c
54: 00000000 0 FILE LOCAL DEFAULT ABS init.c
55: 00000000 0 FILE LOCAL DEFAULT ABS fini.c
56: 00000000 0 FILE LOCAL DEFAULT ABS atexit.c
57: 00000000 0 FILE LOCAL DEFAULT ABS __atexit.c
58: 00000000 0 FILE LOCAL DEFAULT ABS sys_exit.c
59: 00000000 0 FILE LOCAL DEFAULT ABS errno.c
60: 00000000 0 FILE LOCAL DEFAULT ABS libgcc2.c
61: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
62: 00003074 0 OBJECT LOCAL DEFAULT 3 __FRAME_END__
63: 00000000 0 FILE LOCAL DEFAULT ABS impure.c
64: 00003088 1064 OBJECT LOCAL DEFAULT 6 impure_data
65: 00000000 0 FILE LOCAL DEFAULT ABS
66: 00003084 0 NOTYPE LOCAL DEFAULT 5 __fini_array_end
67: 00003080 0 NOTYPE LOCAL DEFAULT 5 __fini_array_start
68: 00003080 0 NOTYPE LOCAL DEFAULT 4 __init_array_end
69: 00003078 0 NOTYPE LOCAL DEFAULT 4 __preinit_array_end
70: 00003078 0 NOTYPE LOCAL DEFAULT 4 __init_array_start
71: 00003078 0 NOTYPE LOCAL DEFAULT 4 __preinit_array_start
72: 00003888 0 NOTYPE GLOBAL DEFAULT ABS __global_pointer$
73: 00001f24 40 OBJECT GLOBAL DEFAULT 2 segcode
74: 00001e1c 8 FUNC GLOBAL DEFAULT 1 __errno
75: 000034b0 0 NOTYPE GLOBAL DEFAULT 7 __SDATA_BEGIN__
76: 000034b0 4 OBJECT GLOBAL DEFAULT 7 _global_impure_ptr
77: 00001a4c 156 FUNC GLOBAL DEFAULT 1 __libc_init_array
78: 000015ec 1072 FUNC GLOBAL HIDDEN 1 __udivdi3
79: 00001ce4 92 FUNC GLOBAL DEFAULT 1 __libc_fini_array
80: 00001bc4 288 FUNC GLOBAL DEFAULT 1 __call_exitprocs
81: 0000008c 76 FUNC GLOBAL DEFAULT 1 _start
82: 00001d54 152 FUNC GLOBAL DEFAULT 1 __register_exitproc
83: 000034e0 0 NOTYPE GLOBAL DEFAULT 9 __BSS_END__
84: 000034bc 0 NOTYPE GLOBAL DEFAULT 8 __bss_start
85: 00001ae8 220 FUNC GLOBAL DEFAULT 1 memset
86: 00000e68 1924 FUNC GLOBAL DEFAULT 1 main
87: 00001f4c 256 OBJECT GLOBAL HIDDEN 2 __clz_tab
88: 00001d40 20 FUNC GLOBAL DEFAULT 1 atexit
89: 000034b8 4 OBJECT GLOBAL DEFAULT 7 _impure_ptr
90: 00003088 0 NOTYPE GLOBAL DEFAULT 6 __DATA_BEGIN__
91: 000034bc 0 NOTYPE GLOBAL DEFAULT 7 _edata
92: 000034e0 0 NOTYPE GLOBAL DEFAULT 9 _end
93: 00001a1c 48 FUNC GLOBAL DEFAULT 1 exit
94: 00001dec 48 FUNC GLOBAL DEFAULT 1 _exit
No version information found in this file.
Attribute Section: riscv
File Attributes
Tag_RISCV_stack_align: 16-bytes
Tag_RISCV_arch: "rv32i2p0_m2p0
_a2p0
"
Tag_RISCV_arch: "rv32i2p0_m2p0"
Tag_RISCV_priv_spec: 1
Tag_RISCV_priv_spec_minor: 11
examples/hdl4se_riscv/test_code/test.mif
浏览文件 @
5f3252a2
此差异已折叠。
点击以展开。
examples/hdl4se_riscv/test_code/test.txt
浏览文件 @
5f3252a2
此差异已折叠。
点击以展开。
examples/hdl4se_riscv/verilog/riscv_core_v4.v
浏览文件 @
5f3252a2
...
...
@@ -227,7 +227,7 @@ module riscv_core(
write
<=
0
;
if
(
opcode
==
5'h08
)
begin
writeaddr
<=
newwriteaddr
;
writeaddr
<=
{
newwriteaddr
[
31
:
2
],
2'b00
}
;
writemask
<=
4'h0
;
writedata
<=
rs2
;
write
<=
1'b1
;
...
...
@@ -296,7 +296,7 @@ module riscv_core(
end
end
else
if
(
state
==
`RISCVSTATE_WAIT_ST
)
begin
write
<=
0
;
writeaddr
<=
lastaddr
+
4
;
writeaddr
<=
{
lastaddr
[
31
:
2
],
2'b0
}
+
4
;
if
(
opcode
==
5'h08
)
begin
case
(
func3
)
1
:
/*sh*/
begin
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录