URL
https://opencores.org/ocsvn/oms8051mini/oms8051mini/trunk
[/] [oms8051mini/] [trunk/] [rtl/] [8051/] [oc8051_psw.v] - Diff between revs 25 and 36
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 25 |
Rev 36 |
Line 104... |
Line 104... |
//
|
//
|
//case writing to psw
|
//case writing to psw
|
always @(posedge clk or negedge resetn)
|
always @(posedge clk or negedge resetn)
|
begin
|
begin
|
if (resetn == 1'b0)
|
if (resetn == 1'b0)
|
data <= #1 `OC8051_RST_PSW;
|
data <= `OC8051_RST_PSW;
|
|
|
//
|
//
|
// write to psw (byte addressable)
|
// write to psw (byte addressable)
|
else begin
|
else begin
|
if (wr & (wr_bit==1'b0) & (wr_addr==`OC8051_SFR_PSW))
|
if (wr & (wr_bit==1'b0) & (wr_addr==`OC8051_SFR_PSW))
|
data[7:1] <= #1 data_in[7:1];
|
data[7:1] <= data_in[7:1];
|
//
|
//
|
// write to psw (bit addressable)
|
// write to psw (bit addressable)
|
else if (wr & wr_bit & (wr_addr[7:3]==`OC8051_SFR_B_PSW))
|
else if (wr & wr_bit & (wr_addr[7:3]==`OC8051_SFR_B_PSW))
|
data[wr_addr[2:0]] <= #1 cy_in;
|
data[wr_addr[2:0]] <= cy_in;
|
else begin
|
else begin
|
case (set) /* synopsys full_case parallel_case */
|
case (set) /* synopsys full_case parallel_case */
|
`OC8051_PS_CY: begin
|
`OC8051_PS_CY: begin
|
//
|
//
|
//write carry
|
//write carry
|
data[7] <= #1 cy_in;
|
data[7] <= cy_in;
|
end
|
end
|
`OC8051_PS_OV: begin
|
`OC8051_PS_OV: begin
|
//
|
//
|
//write carry and overflov
|
//write carry and overflov
|
data[7] <= #1 cy_in;
|
data[7] <= cy_in;
|
data[2] <= #1 ov_in;
|
data[2] <= ov_in;
|
end
|
end
|
`OC8051_PS_AC:begin
|
`OC8051_PS_AC:begin
|
//
|
//
|
//write carry, overflov and ac
|
//write carry, overflov and ac
|
data[7] <= #1 cy_in;
|
data[7] <= cy_in;
|
data[6] <= #1 ac_in;
|
data[6] <= ac_in;
|
data[2] <= #1 ov_in;
|
data[2] <= ov_in;
|
|
|
end
|
end
|
endcase
|
endcase
|
end
|
end
|
end
|
end
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.