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