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

@ -67,14 +67,14 @@ initial begin
$dumpvars(0,p,cycles); $dumpvars(0,p,cycles);
end end
`ifdef OTUPUT_JSON_STATISTICS `ifdef OTUPUT_JSON_STATISTICS
if(!$value$plusargs("VERSION=%s",version)) version="unkown"; if(!$value$plusargs("VERSION=%s",version)) version="unkown";
if(!$value$plusargs("COMMIT=%s",commit)) commit="unkown"; if(!$value$plusargs("COMMIT=%s",commit)) commit="unkown";
if($value$plusargs("STATS=%s",stats_name))begin if($value$plusargs("STATS=%s",stats_name))begin
json_file_descriptor=$fopen(stats_name,"w"); json_file_descriptor=$fopen(stats_name,"w");
$fdisplay(json_file_descriptor,"{\n\"L1_size\":%0d,\n\"9086 verison\":\"%s\",\n\"latest commit\":\"%s\",\n\"Cycles\":[",$rtoi($pow(2,`L1_CACHE_SIZE)),version,commit); $fdisplay(json_file_descriptor,"{\n\"L1_size\":%0d,\n\"9086 verison\":\"%s\",\n\"latest commit\":\"%s\",\n\"Cycles\":[",$rtoi($pow(2,`L1_CACHE_SIZE)),version,commit);
first_json_cycle = 1; first_json_cycle = 1;
end else end else
json_file_descriptor=0; json_file_descriptor=0;
`endif `endif
sane=0; sane=0;
finish=0; finish=0;
@ -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;