Commit ed1210e5 authored by Tao Liu's avatar Tao Liu
Browse files

Add section for each data region

parent 3f584ade
...@@ -347,6 +347,9 @@ class riscv_asm_program_gen extends uvm_object; ...@@ -347,6 +347,9 @@ class riscv_asm_program_gen extends uvm_object;
if (cfg.use_push_data_section) begin if (cfg.use_push_data_section) begin
instr_stream.push_back($sformatf(".pushsection .%0suser_stack,\"aw\",@progbits;", instr_stream.push_back($sformatf(".pushsection .%0suser_stack,\"aw\",@progbits;",
hart_prefix(hart))); hart_prefix(hart)));
end else begin
instr_stream.push_back($sformatf(".section .%0suser_stack,\"aw\",@progbits;",
hart_prefix(hart)));
end end
instr_stream.push_back(".align 12"); instr_stream.push_back(".align 12");
instr_stream.push_back(get_label("user_stack_start:", hart)); instr_stream.push_back(get_label("user_stack_start:", hart));
...@@ -365,6 +368,9 @@ class riscv_asm_program_gen extends uvm_object; ...@@ -365,6 +368,9 @@ class riscv_asm_program_gen extends uvm_object;
if (cfg.use_push_data_section) begin if (cfg.use_push_data_section) begin
instr_stream.push_back($sformatf(".pushsection .%0skernel_stack,\"aw\",@progbits;", instr_stream.push_back($sformatf(".pushsection .%0skernel_stack,\"aw\",@progbits;",
hart_prefix(hart))); hart_prefix(hart)));
end else begin
instr_stream.push_back($sformatf(".section .%0skernel_stack,\"aw\",@progbits;",
hart_prefix(hart)));
end end
instr_stream.push_back(".align 12"); instr_stream.push_back(".align 12");
instr_stream.push_back(get_label("kernel_stack_start:", hart)); instr_stream.push_back(get_label("kernel_stack_start:", hart));
...@@ -1059,6 +1065,9 @@ class riscv_asm_program_gen extends uvm_object; ...@@ -1059,6 +1065,9 @@ class riscv_asm_program_gen extends uvm_object;
if (cfg.use_push_data_section) begin if (cfg.use_push_data_section) begin
instr_stream.push_back($sformatf(".pushsection .%0spage_table,\"aw\",@progbits;", instr_stream.push_back($sformatf(".pushsection .%0spage_table,\"aw\",@progbits;",
hart_prefix(hart))); hart_prefix(hart)));
end else begin
instr_stream.push_back($sformatf(".section .%0spage_table,\"aw\",@progbits;",
hart_prefix(hart)));
end end
foreach(page_table_list.page_table[i]) begin foreach(page_table_list.page_table[i]) begin
page_table_list.page_table[i].gen_page_table_section(page_table_section); page_table_list.page_table[i].gen_page_table_section(page_table_section);
......
...@@ -75,12 +75,18 @@ class riscv_data_page_gen extends uvm_object; ...@@ -75,12 +75,18 @@ class riscv_data_page_gen extends uvm_object;
if (cfg.use_push_data_section) begin if (cfg.use_push_data_section) begin
data_page_str.push_back($sformatf(".pushsection .%0s,\"aw\",@progbits;", data_page_str.push_back($sformatf(".pushsection .%0s,\"aw\",@progbits;",
mem_region_setting[i].name)); mem_region_setting[i].name));
end else begin
data_page_str.push_back($sformatf(".section .%0s,\"aw\",@progbits;",
mem_region_setting[i].name));
end end
data_page_str.push_back($sformatf("%0s:", mem_region_setting[i].name)); data_page_str.push_back($sformatf("%0s:", mem_region_setting[i].name));
end else begin end else begin
if (cfg.use_push_data_section) begin if (cfg.use_push_data_section) begin
data_page_str.push_back($sformatf(".pushsection .%0s,\"aw\",@progbits;", data_page_str.push_back($sformatf(".pushsection .%0s,\"aw\",@progbits;",
{hart_prefix(hart_id), mem_region_setting[i].name})); {hart_prefix(hart_id), mem_region_setting[i].name}));
end else begin
data_page_str.push_back($sformatf(".section .%0s,\"aw\",@progbits;",
{hart_prefix(hart_id), mem_region_setting[i].name}));
end end
data_page_str.push_back($sformatf("%0s:", data_page_str.push_back($sformatf("%0s:",
{hart_prefix(hart_id), mem_region_setting[i].name})); {hart_prefix(hart_id), mem_region_setting[i].name}));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment