mdio_regs: Simplify conditions
Instead of duplicating the cyc/stb condition everywhere, just reuse the one from ack. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
2b7e4f9f16
commit
3b49fedb6d
|
@ -154,7 +154,7 @@ module mdio_regs (
|
||||||
data_read_next[BMCR_DUPLEX] = duplex;
|
data_read_next[BMCR_DUPLEX] = duplex;
|
||||||
data_read_next[BMCR_COLTEST] = coltest;
|
data_read_next[BMCR_COLTEST] = coltest;
|
||||||
|
|
||||||
if (cyc && stb && we) begin
|
if (ack && we) begin
|
||||||
loopback_next = data_write[BMCR_LOOPBACK];
|
loopback_next = data_write[BMCR_LOOPBACK];
|
||||||
pdown_next = data_write[BMCR_PDOWN];
|
pdown_next = data_write[BMCR_PDOWN];
|
||||||
isolate_next = data_write[BMCR_ISOLATE];
|
isolate_next = data_write[BMCR_ISOLATE];
|
||||||
|
@ -186,7 +186,7 @@ module mdio_regs (
|
||||||
data_read_next[BMSR_LSTATUS] = link_status_latched;
|
data_read_next[BMSR_LSTATUS] = link_status_latched;
|
||||||
data_read_next[BMSR_EXTCAP] = 1;
|
data_read_next[BMSR_EXTCAP] = 1;
|
||||||
|
|
||||||
if (cyc && stb && !we)
|
if (ack && !we)
|
||||||
link_status_latched_next = link_status;
|
link_status_latched_next = link_status;
|
||||||
end
|
end
|
||||||
ID1: begin
|
ID1: begin
|
||||||
|
@ -202,38 +202,38 @@ module mdio_regs (
|
||||||
NWCR: if (ENABLE_COUNTERS) begin
|
NWCR: if (ENABLE_COUNTERS) begin
|
||||||
data_read_next = nwc;
|
data_read_next = nwc;
|
||||||
|
|
||||||
if (cyc && stb)
|
if (ack)
|
||||||
nwc_next = we ? data_write : negative_wraparound;
|
nwc_next = we ? data_write : negative_wraparound;
|
||||||
end
|
end
|
||||||
PWCR: if (ENABLE_COUNTERS) begin
|
PWCR: if (ENABLE_COUNTERS) begin
|
||||||
data_read_next = pwc;
|
data_read_next = pwc;
|
||||||
|
|
||||||
if (cyc && stb)
|
if (ack)
|
||||||
pwc_next = we ? data_write : positive_wraparound;
|
pwc_next = we ? data_write : positive_wraparound;
|
||||||
end
|
end
|
||||||
DCR: if (ENABLE_COUNTERS) begin
|
DCR: if (ENABLE_COUNTERS) begin
|
||||||
data_read_next = dc;
|
data_read_next = dc;
|
||||||
|
|
||||||
if (cyc && stb)
|
if (ack)
|
||||||
dc_next = we ? data_write : disconnect;
|
dc_next = we ? data_write : disconnect;
|
||||||
end
|
end
|
||||||
FCCR: if (ENABLE_COUNTERS) begin
|
FCCR: if (ENABLE_COUNTERS) begin
|
||||||
data_read_next = fcc;
|
data_read_next = fcc;
|
||||||
|
|
||||||
if (cyc && stb)
|
if (ack)
|
||||||
fcc_next = we ? data_write : false_carrier;
|
fcc_next = we ? data_write : false_carrier;
|
||||||
end
|
end
|
||||||
SECR: if (ENABLE_COUNTERS) begin
|
SECR: if (ENABLE_COUNTERS) begin
|
||||||
data_read_next = sec;
|
data_read_next = sec;
|
||||||
|
|
||||||
if (cyc && stb)
|
if (ack)
|
||||||
sec_next = we ? data_write : symbol_error;
|
sec_next = we ? data_write : symbol_error;
|
||||||
end
|
end
|
||||||
VCR: begin
|
VCR: begin
|
||||||
data_read_next[VCR_DTEST] = descrambler_test;
|
data_read_next[VCR_DTEST] = descrambler_test;
|
||||||
data_read_next[VCR_LTEST] = link_monitor_test;
|
data_read_next[VCR_LTEST] = link_monitor_test;
|
||||||
|
|
||||||
if (cyc && stb && we) begin
|
if (ack && we) begin
|
||||||
descrambler_test_next = data_write[VCR_DTEST];
|
descrambler_test_next = data_write[VCR_DTEST];
|
||||||
link_monitor_test_next = data_write[VCR_LTEST];
|
link_monitor_test_next = data_write[VCR_LTEST];
|
||||||
end
|
end
|
||||||
|
@ -242,8 +242,8 @@ module mdio_regs (
|
||||||
if (EMULATE_PULLUP) begin
|
if (EMULATE_PULLUP) begin
|
||||||
data_read_next = 16'hFFFF;
|
data_read_next = 16'hFFFF;
|
||||||
end else begin
|
end else begin
|
||||||
|
err = ack;
|
||||||
ack = 0;
|
ack = 0;
|
||||||
err = stb && cyc;
|
|
||||||
data_read_next = 16'hXXXX;
|
data_read_next = 16'hXXXX;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue