Code Monkey home page Code Monkey logo

openc910's People

Contributors

purplelegant avatar secworks avatar shangyunhai avatar taurusxkyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openc910's Issues

Srec2vmem is binary with no executable permissions

The binary in smart_run/tests/bin/Srec2vmem is not executable after "git clone"
During compile the work/*.log shows the following:
make: execvp: ../tests/bin/Srec2vmem: Permission denied

Suggest adding "chmod a+rx" in Makefile/Setup scripts, or using python script instead.
See: T-head-Semi/wujian100_open#46

Also where is source to Srec2vmem?

Fix the Makefile in smart_run

In the Makefile in smart_run directory, the last five line lack the other half of "
@echo " make runcase CASE=coremark SIM=verilator THREADS=8 : run case 'coremark' without dump(by verilator) with 8 threads;
@echo " make cleanVerilator : clean the verilator generated file before Verilator operations;
@echo " make compile SIM=verilator DUMP=on THREADS=8 : run compile with dump (by Verilator with dump) with 8 threads;
@echo " make buildVerilator : run build executable file with Verilator;
@echo " make runVerilator : run simulation file with Verilator;

simulation finished with error

I'm using the XuanTie C910 simulation and always get an error simulation finished with error. Does the great god know what the reason is?

NOT ABLE TO SYNTHESIZE IN OPENLANE

unable to compile the openc910 using OpenLANE getting errors in verilator the errors - %Error: //openlane/designs/RISCV_CPU/src/ct_ifu_icache_data_array0.v:264:3: syntax error, unexpected '.'
264 | .A (ifu_icache_index[WIDTH:3] ),
| ^
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1368:33: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1368 | assign st_dc_had_bkpta_addr[8-1:VA_WIDTH] = mmu_lsu_mmu_en | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1368:42: syntax error, unexpected ']', expecting TYPE-IDENTIFIER 1368 | assign st_dc_had_bkpta_addr[8-1:VA_WIDTH] = mmu_lsu_mmu_en
| ^
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1369:22: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1369 | ? {8-VA_WIDTH{had_yy_xx_bkpta_base[VA_WIDTH-1]}}
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1369:53: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1369 | ? {8-VA_WIDTH{had_yy_xx_bkpta_base[VA_WIDTH-1]}}
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1370:44: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1370 | : had_yy_xx_bkpta_base[8-1:VA_WIDTH]; | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1372:29: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1372 | assign st_dc_had_bkpta_addr[VA_WIDTH-1:0] = {had_yy_xx_bkpta_base[VA_WIDTH-1:8], | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1372:68: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1372 | assign st_dc_had_bkpta_addr[VA_WIDTH-1:0] = {had_yy_xx_bkpta_base[VA_WIDTH-1:8], | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1376:33: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1376 | assign st_dc_had_bkptb_addr[8-1:VA_WIDTH] = mmu_lsu_mmu_en
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1376:42: syntax error, unexpected ']', expecting TYPE-IDENTIFIER
1376 | assign st_dc_had_bkptb_addr[8-1:VA_WIDTH] = mmu_lsu_mmu_en | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1377:22: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1377 | ? {8-VA_WIDTH{had_yy_xx_bkptb_base[VA_WIDTH-1]}} | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1377:53: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1377 | ? {8-VA_WIDTH{had_yy_xx_bkptb_base[VA_WIDTH-1]}} | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1378:44: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1378 | : had_yy_xx_bkptb_base[8-1:VA_WIDTH];
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1380:29: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1380 | assign st_dc_had_bkptb_addr[VA_WIDTH-1:0] = {had_yy_xx_bkptb_base[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1380:68: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1380 | assign st_dc_had_bkptb_addr[VA_WIDTH-1:0] = {had_yy_xx_bkptb_base[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1384:25: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1384 | assign st_dc_bkpta_addr[VA_WIDTH-1:0] = {st_dc_va[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1384:56: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1384 | assign st_dc_bkpta_addr[VA_WIDTH-1:0] = {st_dc_va[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1388:25: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1388 | assign st_dc_bkptb_addr[VA_WIDTH-1:0] = {st_dc_va[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1388:56: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1388 | assign st_dc_bkptb_addr[VA_WIDTH-1:0] = {st_dc_va[VA_WIDTH-1:8],
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1393:61: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1393 | ^ (st_dc_had_bkpta_addr[VA_WIDTH-1:0] | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1394:60: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1394 | == st_dc_bkpta_addr[VA_WIDTH-1:0]);
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1397:61: Define or directive not defined: 'VA_WIDTH' : ... Suggested alternative: 'PA_WIDTH'
1397 | ^ (st_dc_had_bkptb_addr[VA_WIDTH-1:0] | ^~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_lsu_st_dc.v:1398:60: Define or directive not defined: 'VA_WIDTH'
: ... Suggested alternative: 'PA_WIDTH' 1398 | == st_dc_bkptb_addr[VA_WIDTH-1:0]);
| ^~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_l2cache_dirty_array_16way.v:33:29: Define or directive not defined: 'L2C_TAG_INDEX_WIDTH' 33 | parameter TAG_INDEX_WIDTH = L2C_TAG_INDEX_WIDTH;
| ^~~~~~~~~~~~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_l2cache_dirty_array_16way.v:33:49: syntax error, unexpected ';', expecting TYPE-IDENTIFIER
33 | parameter TAG_INDEX_WIDTH = L2C_TAG_INDEX_WIDTH; | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_l2cache_dirty_array_16way.v:76:3: syntax error, unexpected '.' 76 | .A (dirty_idx ), | ^ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1612:21: Define or directive not defined: 'PLIC_INT_NUM'
1612 | plic_top #(.INT_NUM(PLIC_INT_NUM+16), | ^~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1613:25: Define or directive not defined: 'PLIC_HART_NUM'
1613 | .HART_NUM(PLIC_HART_NUM), | ^~~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1614:23: Define or directive not defined: 'PLIC_ID_NUM'
1614 | .ID_NUM(PLIC_ID_NUM), | ^~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1615:25: Define or directive not defined: 'PLIC_PRIO_BIT'
1615 | .PRIO_BIT(PLIC_PRIO_BIT), | ^~~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1616:29: Define or directive not defined: 'MAX_HART_NUM'
1616 | .MAX_HART_NUM(MAX_HART_NUM)) x_plic_top( | ^~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1651:21: Define or directive not defined: 'PLIC_INT_NUM'
1651 | assign plic_int_vld[PLIC_INT_NUM+15:0] = {pad_plic_int_vld[PLIC_INT_NUM-1:0],14'b0,l2c_plic_ecc_int_vld,1'b0};
| ^~~~~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/openC910.v:1651:61: Define or directive not defined: 'PLIC_INT_NUM' 1651 | assign plic_int_vld[PLIC_INT_NUM+15:0] = {pad_plic_int_vld[PLIC_INT_NUM-1:0],14'b0,l2c_plic_ecc_int_vld,1'b0}; | ^~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/openC910.v:1652:21: Define or directive not defined: 'PLIC_INT_NUM'
1652 | assign plic_int_cfg[PLIC_INT_NUM+15:0] = {pad_plic_int_cfg[PLIC_INT_NUM-1:0],16'b0};
| ^~~~~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/openC910.v:1652:61: Define or directive not defined: 'PLIC_INT_NUM' 1652 | assign plic_int_cfg[PLIC_INT_NUM+15:0] = {pad_plic_int_cfg[PLIC_INT_NUM-1:0],16'b0}; | ^~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_ifu_icache_predecd_array0.v:120:3: syntax error, unexpected '.' 120 | .A (ifu_icache_index[WIDTH:3] ), | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_ebiu_read_channel.v:511:19: Define or directive not defined: 'SAB_DEPTH'
511 | parameter DEPTH = SAB_DEPTH; | ^~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_ebiu_read_channel.v:511:29: syntax error, unexpected ';', expecting TYPE-IDENTIFIER 511 | parameter DEPTH = SAB_DEPTH;
| ^
%Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:800:20: Define or directive not defined: 'SAB_DEPTH' 800 | parameter DEPTH = SAB_DEPTH;
| ^~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:800:30: syntax error, unexpected ';', expecting TYPE-IDENTIFIER
800 | parameter DEPTH = SAB_DEPTH; | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:801:20: Define or directive not defined: 'SAB_RDEPTH'
801 | parameter RDEPTH = SAB_RDEPTH; | ^~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:801:31: syntax error, unexpected ';', expecting TYPE-IDENTIFIER 801 | parameter RDEPTH = SAB_RDEPTH;
| ^
%Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:802:20: Define or directive not defined: 'SAB_WDEPTH' 802 | parameter WDEPTH = SAB_WDEPTH;
| ^~~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_sab.v:802:31: syntax error, unexpected ';', expecting TYPE-IDENTIFIER
802 | parameter WDEPTH = SAB_WDEPTH; | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_dp_sel.v:105:19: Define or directive not defined: 'SAB_DEPTH'
105 | parameter DEPTH = SAB_DEPTH; | ^~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_ciu_snb_dp_sel.v:105:29: syntax error, unexpected ';', expecting TYPE-IDENTIFIER 105 | parameter DEPTH = SAB_DEPTH;
| ^
%Error: //openlane/designs/RISCV_CPU/src/ct_l2c_cmp.v:462:30: Define or directive not defined: 'L2C_TAG_INDEX_WIDTH' 462 | parameter TAG_INDEX_LENTH = L2C_TAG_INDEX_WIDTH;
| ^~~~~~~~~~~~~~~~~~~~
%Error: //openlane/designs/RISCV_CPU/src/ct_l2c_cmp.v:462:50: syntax error, unexpected ';', expecting TYPE-IDENTIFIER
462 | parameter TAG_INDEX_LENTH = L2C_TAG_INDEX_WIDTH; | ^ %Error: //openlane/designs/RISCV_CPU/src/ct_l2c_cmp.v:463:30: Define or directive not defined: 'L2C_TAG_DATA_WIDTH'
463 | parameter TAG_TAG_LENTH = L2C_TAG_DATA_WIDTH; | ^~~~~~~~~~~~~~~~~~~ %Error: //openlane/designs/RISCV_CPU/src/ct_l2c_cmp.v:463:49: syntax error, unexpected ';', expecting TYPE-IDENTIFIER 463 | parameter TAG_TAG_LENTH = L2C_TAG_DATA_WIDTH;
| ^
%Error: Exiting due to too many errors enco
verilator.log
untered; --error-limit=50

tried to convert the cpu_cfig.h and sysmap.h to .v by using `parameter still no help

Getting Started

Hi!

I was looking to get started with using T-Head-Semi's openc910 core, but just had a few questions about the setup required.

  1. What are the minimum specifications (like the number of LUTs) an FPGA board must have to be able to run this core? Are there any recommended FPGAs?
  2. Can this core run Linux? What other operating system(s) does this core support?
  3. Lastly, is there any recommended OS which I should use when working with the files for this core?

The xuantie910 published in ISCA20

It is Xuantie-910: A Commercial Multi-Core 12-Stage Pipeline Out-of-Order 64-bit High Performance RISC-V Processor with Vector Extension.
I am curious will it be released in the future?

Problems with provided toolchain due to geographical restrictions

For the provided toolchain URL, right now, is not posible to register and download, (AFAIK) from out of china phone number.
https://occ.t-head.cn/community/download?id=3948120165480468480

With an spanish phone number (+34XXXXXXXXX), I cannot register an account to download the toolchain.
I tried with my dingchat account, but again the form asked for a +86 phone number

Sadly the RiscV toolchain provided with Ubuntu does not support newlib-nano

/openc910/smart_run/work#  make -s clean && make -s all CPU_ARCH_FLAG_0=c910  ENDIAN_MODE=little-endian CASENAME=hello_world FILE=hello_world
riscv64-unknown-elf-gcc: fatal error: cannot read spec file 'nano.specs': No such file or directory

¿Must I build my own RiscV tool chain (with newlib-nano)?

Clarification

Is the source code generated from some other source language? We notice the gen_RTL directory name.

This would be useful to know; for example, will pull requests to this repo be accepted, or would the fixes need to be made upstream and then the RTL regenerated by T Head?

/bin/sh: 1: Syntax error: Unterminated quoted string Makefile:249: recipe for target 'help' failed

/T-head-Semi/openc910/smart_run$ make
########## Smart Help Info ##########
This Makefile is the entrance of T-Head Smart simulation environment
Usage: make [target] [arguments]
Available targets:
compile : compile the RTL and Smart tbench (using vcs or ius)
showcase : list all valid cases under current configuration
buildcase CASE=[casename] : clean and compile the .c/.s case [casename]
[casename]_build : compile the .c/.s case [casename]
runcase CASE=[casename] : run the case [casename]
regress : run all cases and summarize the regress result
memlist : generate sram list with the help of VCS/Verdi
cleansim : clean files generated by simulator in ./work
cleancase : clean files generated by GNU in ./work
clean : clean ./work
Optional arguments:
SIM= : options: vcs / nc / verilator(use version 4.215 or newer)
CASE= : options: the list print by 'make showcase'
DUMP= : options: on / off
Examples:
make runcase CASE=dhry : run case 'dhry' (by iverilog withtout dump)
make runcase CASE=dhry SIM=nc : run case 'dhry' (by nc withtout dump)
make runcase CASE=dhry DUMP=on : run case 'dhry' with dump
/bin/sh: 1: Syntax error: Unterminated quoted string
Makefile:249: recipe for target 'help' failed
make: *** [help] Error 2

Non-standard RISC-V Extension

Looking in the instruction decoder I encountered non-standard RISC-V instructions.

//==========================================================
// lsi instructions
//==========================================================
//----------------------------------------------------------
// Contrl Signals
//----------------------------------------------------------
assign lsi_inst[31:0] = dp_split_short_inst[31:0];
assign lsi_load = !lsi_inst[12];
assign lsi_post = lsi_inst[28];
// &CombBeg; @170
always @( lsi_inst[26:20])
begin
case(lsi_inst[26:25])
2'b00: lsi_imm[7:0] = {{3{lsi_inst[24]}},lsi_inst[24:20]};
2'b01: lsi_imm[7:0] = {{2{lsi_inst[24]}},lsi_inst[24:20],1'b0};
2'b10: lsi_imm[7:0] = {lsi_inst[24],lsi_inst[24:20],2'b0};
2'b11: lsi_imm[7:0] = {lsi_inst[24:20],3'b0};
default:lsi_imm[7:0] = {8{1'bx}};
endcase
// &CombEnd; @178
end
assign lsi_offset[11:0] = lsi_post ? 12'b0 : {{4{lsi_imm[7]}},lsi_imm[7:0]};
assign lsi_dep_info[1:0] = 2'b11; //preg_dep_mask[1:0]
assign lsi_dep_info[2] = 1'b0; //vreg_dep_mask
assign lsi_dep_info[3] = 1'b0; //srcv1_dep_mask
//----------------------------------------------------------
// Split Instruction 0
//----------------------------------------------------------
//split inst 1: addi rs1,rs1,sign_ext(imm5<<imm2)
// &CombBeg; @190
always @( lsi_imm[7:0]
or lsi_inst[19:15])
begin
lsi_inst0_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsi_inst0_data[31:20] = {{4{lsi_imm[7]}},lsi_imm[7:0]};
lsi_inst0_data[19:15] = lsi_inst[19:15];
lsi_inst0_data[14:12] = 3'b0;
lsi_inst0_data[11:7] = lsi_inst[19:15];
lsi_inst0_data[6:0] = 7'b0010011;
lsi_inst0_data[IR_INST_TYPE:IR_INST_TYPE-9] = ALU;
lsi_inst0_data[IR_SRC0_VLD] = 1'b1;
lsi_inst0_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsi_inst[19:15]};
lsi_inst0_data[IR_DST_VLD] = 1'b1;
lsi_inst0_data[IR_DST_REG:IR_DST_REG-5] = {1'b0,lsi_inst[19:15]};
lsi_inst0_data[IR_SPLIT] = 1'b1;
lsi_inst0_data[IR_LENGTH] = 1'b1;
lsi_inst0_data[IR_IID_PLUS:IR_IID_PLUS-3] = 4'b1;
end
// &CombEnd; @208
end
//----------------------------------------------------------
// Split Instruction 1 : load
//----------------------------------------------------------
//split inst 0: lb/lh/lw/ld/lbu/lhu/lwu rd,(rs1),sign_ext(imm5<<imm2)
// &CombBeg; @214
always @( lsi_inst[11:7]
or lsi_offset[11:0]
or lsi_inst[19:15]
or lsi_inst[31:29])
begin
lsi_inst1_load_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsi_inst1_load_data[31:20] = lsi_offset[11:0];
lsi_inst1_load_data[19:15] = lsi_inst[19:15];
lsi_inst1_load_data[14:12] = lsi_inst[31:29];
lsi_inst1_load_data[11:7] = lsi_inst[11:7];
lsi_inst1_load_data[6:0] = 7'b0000011;
lsi_inst1_load_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU;
lsi_inst1_load_data[IR_SRC0_VLD] = 1'b1;
lsi_inst1_load_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsi_inst[19:15]};
lsi_inst1_load_data[IR_DST_VLD] = 1'b1;
lsi_inst1_load_data[IR_DST_REG:IR_DST_REG-5] = {1'b0,lsi_inst[11:7]};
lsi_inst1_load_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @230
end
//----------------------------------------------------------
// Split Instruction 1 : store
//----------------------------------------------------------
//split inst 0: sb/sh/sw/sd/sbu/shu/swu rs2,(rs1),sign_ext(imm5<<imm2)
// &CombBeg; @236
always @( lsi_inst[11:7]
or lsi_offset[11:0]
or lsi_inst[19:15]
or lsi_inst[31:29])
begin
lsi_inst1_store_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsi_inst1_store_data[31:25] = lsi_offset[11:5];
lsi_inst1_store_data[24:20] = lsi_inst[11:7];
lsi_inst1_store_data[19:15] = lsi_inst[19:15];
lsi_inst1_store_data[14:12] = lsi_inst[31:29];
lsi_inst1_store_data[11:7] = lsi_offset[4:0];
lsi_inst1_store_data[6:0] = 7'b0100011;
lsi_inst1_store_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU_P5;
lsi_inst1_store_data[IR_SRC0_VLD] = 1'b1;
lsi_inst1_store_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsi_inst[19:15]};
lsi_inst1_store_data[IR_SRC1_VLD] = 1'b1;
lsi_inst1_store_data[IR_SRC1_REG:IR_SRC1_REG-5] = {1'b0,lsi_inst[11:7]};
lsi_inst1_store_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @253
end
//----------------------------------------------------------
// Split Instruction Data
//----------------------------------------------------------
assign lsi_inst1_data[IR_WIDTH-1:0] = lsi_load
? lsi_inst1_load_data[IR_WIDTH-1:0]
: lsi_inst1_store_data[IR_WIDTH-1:0];
//==========================================================
// lsd instructions
//==========================================================
//----------------------------------------------------------
// Contrl Signals
//----------------------------------------------------------
assign lsd_inst[31:0] = dp_split_short_inst[31:0];
assign lsd_load = !lsd_inst[12];
assign lsd_word = !lsd_inst[27];
// &CombBeg; @273
always @( lsd_inst[28:27])
begin
case(lsd_inst[28:27])
2'b00: lsd_func3[2:0] = 3'b010;
2'b10: lsd_func3[2:0] = 3'b110;
2'b11: lsd_func3[2:0] = 3'b011;
default:lsd_func3[2:0] = {3{1'bx}};
endcase
// &CombEnd; @280
end
assign lsd_inst0_offset[11:0] = lsd_word ? {7'b0,lsd_inst[26:25],3'b0}
: {6'b0,lsd_inst[26:25],4'b0};
assign lsd_inst1_offset[11:0] = lsd_word ? lsd_inst0_offset[11:0] + {8'b0,4'd4}
: lsd_inst0_offset[11:0] + {8'b0,4'd8};
assign lsd_dep_info[1:0] = 2'b11; //preg_dep_mask[1:0]
assign lsd_dep_info[2] = 1'b0; //vreg_dep_mask
assign lsd_dep_info[3] = 1'b0; //srcv1_dep_mask
//----------------------------------------------------------
// Split Instruction 0 : load
//----------------------------------------------------------
//split inst 0: lw/ld/lwu rd,(rs1),sign_ext(imm5<<imm2)
// &CombBeg; @295
always @( lsd_inst[11:7]
or lsd_func3[2:0]
or lsd_inst[19:15]
or lsd_inst0_offset[11:0])
begin
lsd_inst0_load_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsd_inst0_load_data[31:20] = lsd_inst0_offset[11:0];
lsd_inst0_load_data[19:15] = lsd_inst[19:15];
lsd_inst0_load_data[14:12] = lsd_func3[2:0];
lsd_inst0_load_data[11:7] = lsd_inst[11:7];
lsd_inst0_load_data[6:0] = 7'b0000011;
lsd_inst0_load_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU;
lsd_inst0_load_data[IR_SRC0_VLD] = 1'b1;
lsd_inst0_load_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsd_inst[19:15]};
lsd_inst0_load_data[IR_DST_VLD] = 1'b1;
lsd_inst0_load_data[IR_DST_REG:IR_DST_REG-5] = {1'b0,lsd_inst[11:7]};
lsd_inst0_load_data[IR_SPLIT] = 1'b1;
lsd_inst0_load_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @312
end
//----------------------------------------------------------
// Split Instruction 0 : store
//----------------------------------------------------------
//split inst 0: sw/sd/swu rs2,(rs1),sign_ext(imm5<<imm2)
// &CombBeg; @318
always @( lsd_inst[11:7]
or lsd_func3[2:0]
or lsd_inst[19:15]
or lsd_inst0_offset[11:0])
begin
lsd_inst0_store_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsd_inst0_store_data[31:25] = lsd_inst0_offset[11:5];
lsd_inst0_store_data[24:20] = lsd_inst[11:7];
lsd_inst0_store_data[19:15] = lsd_inst[19:15];
lsd_inst0_store_data[14:12] = lsd_func3[2:0];
lsd_inst0_store_data[11:7] = lsd_inst0_offset[4:0];
lsd_inst0_store_data[6:0] = 7'b0100011;
lsd_inst0_store_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU_P5;
lsd_inst0_store_data[IR_SRC0_VLD] = 1'b1;
lsd_inst0_store_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsd_inst[19:15]};
lsd_inst0_store_data[IR_SRC1_VLD] = 1'b1;
lsd_inst0_store_data[IR_SRC1_REG:IR_SRC1_REG-5] = {1'b0,lsd_inst[11:7]};
lsd_inst0_store_data[IR_SPLIT] = 1'b1;
lsd_inst0_store_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @336
end
//----------------------------------------------------------
// Split Instruction 1 : load
//----------------------------------------------------------
//split inst 1: lw/ld/lwu rd+1,(rs1),sign_ext(imm5<<imm2+4/8)
// &CombBeg; @342
always @( lsd_inst[24:15]
or lsd_func3[2:0]
or lsd_inst1_offset[11:0])
begin
lsd_inst1_load_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsd_inst1_load_data[31:20] = lsd_inst1_offset[11:0];
lsd_inst1_load_data[19:15] = lsd_inst[19:15];
lsd_inst1_load_data[14:12] = lsd_func3[2:0];
lsd_inst1_load_data[11:7] = lsd_inst[24:20];
lsd_inst1_load_data[6:0] = 7'b0000011;
lsd_inst1_load_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU;
lsd_inst1_load_data[IR_SRC0_VLD] = 1'b1;
lsd_inst1_load_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsd_inst[19:15]};
lsd_inst1_load_data[IR_DST_VLD] = 1'b1;
lsd_inst1_load_data[IR_DST_REG:IR_DST_REG-5] = {1'b0,lsd_inst[24:20]};
lsd_inst1_load_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @358
end
//----------------------------------------------------------
// Split Instruction 1 : store
//----------------------------------------------------------
//split inst 1: sw/sd/swu rs2+1,(rs1),sign_ext(imm5<<imm2+4/8)
// &CombBeg; @364
always @( lsd_inst1_offset[11:0]
or lsd_func3[2:0]
or lsd_inst[24:15])
begin
lsd_inst1_store_data[IR_WIDTH-1:0] = {IR_WIDTH{1'b0}};
if(1'b1) begin
lsd_inst1_store_data[31:25] = lsd_inst1_offset[11:5];
lsd_inst1_store_data[24:20] = lsd_inst[24:20];
lsd_inst1_store_data[19:15] = lsd_inst[19:15];
lsd_inst1_store_data[14:12] = lsd_func3[2:0];
lsd_inst1_store_data[11:7] = lsd_inst1_offset[4:0];
lsd_inst1_store_data[6:0] = 7'b0100011;
lsd_inst1_store_data[IR_INST_TYPE:IR_INST_TYPE-9] = LSU_P5;
lsd_inst1_store_data[IR_SRC0_VLD] = 1'b1;
lsd_inst1_store_data[IR_SRC0_REG:IR_SRC0_REG-5] = {1'b0,lsd_inst[19:15]};
lsd_inst1_store_data[IR_SRC1_VLD] = 1'b1;
lsd_inst1_store_data[IR_SRC1_REG:IR_SRC1_REG-5] = {1'b0,lsd_inst[24:20]};
lsd_inst1_store_data[IR_LENGTH] = 1'b1;
end
// &CombEnd; @381
end
//----------------------------------------------------------
// Split Instruction Data
//----------------------------------------------------------
assign lsd_inst0_data[IR_WIDTH-1:0] = lsd_load
? lsd_inst0_load_data[IR_WIDTH-1:0]
: lsd_inst0_store_data[IR_WIDTH-1:0];
assign lsd_inst1_data[IR_WIDTH-1:0] = lsd_load
? lsd_inst1_load_data[IR_WIDTH-1:0]
: lsd_inst1_store_data[IR_WIDTH-1:0];

Opcodes, of these non-standard Store instructions, seem to be decoded here:

|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00000_101_0001011) //srb
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00100_101_0001011) //srh
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01000_101_0001011) //srw
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01100_101_0001011) //srd
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00010_101_0001011) //surb
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00110_101_0001011) //surh
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01010_101_0001011) //surw
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01110_101_0001011) //surd
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00001_101_0001011) //sbib
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00011_101_0001011) //sbia
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00101_101_0001011) //shib
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b00111_101_0001011) //shia
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01001_101_0001011) //swib
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01011_101_0001011) //swia
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01101_101_0001011) //sdib
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01111_101_0001011) //sdia
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b11100_101_0001011) //swd
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b11111_101_0001011) //sdd
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01000_111_0001011) //fsrw
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01100_111_0001011) //fsrd
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01010_111_0001011) //fsurw
|| ({x_inst[31:27],x_inst[14:12],x_inst[6:0]} == 15'b01110_111_0001011); //fsurd

We can clearly see that these are store-type non-standard instructions named: SRB, SRH, SRW, SRD, SURB, SURH, SURW, SURD, SBIB, SBIA, SHIB, SHIA, SWIB, SWIA, SDIA, SDIB, SWD, SDD, FSRW, FSRD, FSURW, FSURD.
Some of these instructions are decoded from the split short decoder I referred to above.

This also applies to load-type instructions. And there is probably some other instructions that I haven't quite identified yet.

I am looking for documentation about this RISC-V extension, but I couldn't find anything.
Could you provide documentation about it?

c 模型如何恢复

从代码里面 最初应该有c模型的,但是好像注释掉了, 什么地方能够搞到有完整c模型代码的版本呢

vcs emulation error in ubuntu system

reveal:
Warning-[STASKW_CO1] Cannot open file
The file 'data.pat' could not be opened. No such file or directory.
Please ensure that the file exists with proper permissions.

Warning-[STASKW_RMCOF] Cannot open file
../logical/tb/tb.v, 137
Cannot open file 'data.pat' passed as argument to $readmem.
Please verify that the first argument to $readmem is a file that exists with
proper permissions.

Could someone please tell me what the problem is, or how to fix it

ERROR while making runcase

Reporting errors whether SIM=verilator %Error: Cannot find file containing module: # or SIM=iverilog /home/v***r/codes/fun/openc910/newlib/bin/riscv64-unknown-elf-gcc: Command not found

Anyone meets the same problem? I v installed the toolchain "Xuantie-900-gcc-elf-newlib-mingw-V2.6.1-20220906" in my Makefile already.

Toolchain Sources

I'm trying to sort out how to run this, it looks like there's some GCC arguments that aren't upstream. I found some links to binary toolchains, but I'd prefer to build my own toolchains from source. Is that source online anywhere?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.