More small fixes

This commit is contained in:
(Tim) Efthimis Kritikos 2023-11-04 08:31:05 +00:00
parent 694f708a32
commit c7ddf3fa9e
2 changed files with 24 additions and 25 deletions

View File

@ -47,10 +47,10 @@ always @ ( * ) begin
`ALU_OP_ADD_SIGNED_B: {C_FLAG,OUT[7:0]}=A[7:0]+SIGNED_8B; `ALU_OP_ADD_SIGNED_B: {C_FLAG,OUT[7:0]}=A[7:0]+SIGNED_8B;
`ALU_OP_SUB: {C_FLAG,OUT[7:0]}=A[7:0]-B[7:0]; `ALU_OP_SUB: {C_FLAG,OUT[7:0]}=A[7:0]-B[7:0];
`ALU_OP_SUB_REVERSE: {C_FLAG,OUT[7:0]}=B[7:0]-A[7:0]; `ALU_OP_SUB_REVERSE: {C_FLAG,OUT[7:0]}=B[7:0]-A[7:0];
`ALU_OP_AND: begin C_FLAG=0;OUT=A&B; end `ALU_OP_AND: begin C_FLAG=0;OUT[7:0]=A[7:0]&B[7:0]; end
`ALU_OP_OR: begin C_FLAG=0;OUT=A|B; end `ALU_OP_OR: begin C_FLAG=0;OUT[7:0]=A[7:0]|B[7:0]; end
`ALU_OP_XOR: begin C_FLAG=0;OUT=A^B; end `ALU_OP_XOR: begin C_FLAG=0;OUT[7:0]=A[7:0]^B[7:0]; end
`ALU_OP_SHIFT_LEFT: begin C_FLAG=(A&16'h80)==16'h80;OUT=A<<B; end `ALU_OP_SHIFT_LEFT: begin C_FLAG=(A&16'h80)==16'h80;OUT[7:0]=A[7:0]<<B; end
endcase endcase
end end
end end

View File

@ -117,25 +117,24 @@ always @(new_instruction) begin
end end
`endif `endif
reg [1:0] finish;
`ifndef YOSYS `ifndef SYNTHESIS
string memdump_name;
`endif
always @(posedge HALT) begin
`ifndef YOSYS
if($value$plusargs("MEMDUMP=%s",memdump_name))begin
$writememh(memdump_name, sysmem.memory,0,32767);
end
`endif
finish<=2'd1;
end
`ifdef OTUPUT_JSON_STATISTICS `ifdef OTUPUT_JSON_STATISTICS
reg [128:0] instruction_count_temp; reg [128:0] instruction_count_temp;
`endif `endif
`ifndef SYNTHESIS string memdump_name;
always @(posedge HALT) begin
if($value$plusargs("MEMDUMP=%s",memdump_name))begin
$writememh(memdump_name, sysmem.memory,0,32767);
end
finish<=2'd1;
end
reg [1:0] finish;
reg sane; reg sane;
reg [128:0] cycles; reg [128:0] cycles;