add support for ebreak inst
Signed-off-by: liangkangnan <liangkangnan@163.com>pull/1/head
parent
5f64a5f8ae
commit
e28381dbcf
|
@ -85,7 +85,7 @@ module clint(
|
|||
if (rst == `RstEnable) begin
|
||||
int_state = S_INT_IDLE;
|
||||
end else begin
|
||||
if (inst_i == `INST_ECALL) begin
|
||||
if (inst_i == `INST_ECALL || inst_i == `INST_EBREAK) begin
|
||||
int_state = S_INT_SYNC_ASSERT;
|
||||
end else if (int_flag_i != `INT_NONE && global_int_en_i == `True) begin
|
||||
int_state = S_INT_ASYNC_ASSERT;
|
||||
|
@ -107,10 +107,19 @@ module clint(
|
|||
case (csr_state)
|
||||
S_CSR_IDLE: begin
|
||||
if (int_state == S_INT_SYNC_ASSERT) begin
|
||||
// ecallÒì³£
|
||||
cause <= 32'd11;
|
||||
csr_state <= S_CSR_MEPC;
|
||||
inst_addr <= inst_addr_i;
|
||||
case (inst_i)
|
||||
`INST_ECALL: begin
|
||||
cause <= 32'd11;
|
||||
end
|
||||
`INST_EBREAK: begin
|
||||
cause <= 32'd3;
|
||||
end
|
||||
default: begin
|
||||
cause <= 32'd10;
|
||||
end
|
||||
endcase
|
||||
end else if (int_state == S_INT_ASYNC_ASSERT) begin
|
||||
// ¶¨Ê±Æ÷ÖжÏ
|
||||
cause <= 32'h80000004;
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
|
||||
`define INST_FENCE 7'b0001111
|
||||
`define INST_ECALL 32'h73
|
||||
`define INST_EBREAK 32'h00100073
|
||||
|
||||
// J type inst
|
||||
`define INST_TYPE_B 7'b1100011
|
||||
|
|
Loading…
Reference in New Issue