URL
https://opencores.org/ocsvn/ao486/ao486/trunk
Subversion Repositories ao486
[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_BOUND.txt] - Rev 2
Compare with Previous | Blame | View Log
<defines>
`define CMD_BOUND #AUTOGEN_NEXT_CMD
`define CMDEX_BOUND_STEP_FIRST 4'd0
`define CMDEX_BOUND_STEP_LAST 4'd1
</defines>
<decode>
dec_ready_modregrm_one && decoder[7:0] == 8'h62
prefix_group_1_lock || `DEC_MODREGRM_IS_MOD_11
`CMD_BOUND
SET(dec_cmdex, `CMDEX_BOUND_STEP_FIRST);
SET(consume_modregrm_one);
SET(dec_is_complex);
</decode>
<microcode>
`CMDEX_BOUND_STEP_FIRST
LAST(`CMDEX_BOUND_STEP_LAST);
</microcode>
<read>
IF(rd_cmd == `CMD_BOUND && rd_cmdex == `CMDEX_BOUND_STEP_FIRST);
SET(rd_src_is_memory);
IF(rd_mutex_busy_memory); SET(rd_waiting);
ELSE();
SET(read_virtual);
IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
ENDIF();
ENDIF();
</read>
<read>
IF(rd_cmd == `CMD_BOUND && rd_cmdex == `CMDEX_BOUND_STEP_LAST);
SET(address_ea_buffer);
SET(rd_dst_is_reg);
SET(rd_src_is_memory);
IF(rd_mutex_busy_memory); SET(rd_waiting);
ELSE();
SET(read_virtual); // special ea
IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
ENDIF();
ENDIF();
</read>
<execute>
IF(exe_cmd == `CMD_BOUND && exe_cmdex == `CMDEX_BOUND_STEP_FIRST);
SAVE(exe_buffer, src);
ENDIF();
</execute>
<execute_local>
wire signed [31:0] e_bound_min;
wire signed [31:0] e_bound_max;
wire signed [31:0] e_bound_dst;
assign e_bound_min = (exe_operand_16bit)? { {16{exe_buffer[15]}}, exe_buffer[15:0] } : exe_buffer;
assign e_bound_max = (exe_operand_16bit)? { {16{src[15]}}, src[15:0] } : src;
assign e_bound_dst = (exe_operand_16bit)? { {16{dst[15]}}, dst[15:0] } : dst;
assign exe_bound_fault = exe_cmd == `CMD_BOUND && exe_cmdex == `CMDEX_BOUND_STEP_LAST &&
(e_bound_dst < e_bound_min || e_bound_dst > e_bound_max);
</execute_local>
<execute>
IF(exe_cmd == `CMD_BOUND && exe_cmdex == `CMDEX_BOUND_STEP_LAST);
IF(exe_bound_fault); SET(exe_waiting); ENDIF();
ENDIF();
</execute>
<write>
IF(wr_cmd == `CMD_BOUND && wr_cmdex == `CMDEX_BOUND_STEP_FIRST);
SET(wr_not_finished);
ENDIF();
</write>