Skip to content

Commit

Permalink
modules/zstd/zstd_dec: use regular cast instead of checked_cast on st…
Browse files Browse the repository at this point in the history
…atus enums

Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
  • Loading branch information
lpawelcz committed Jan 13, 2025
1 parent 082327f commit 883f383
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions xls/modules/zstd/zstd_dec.x
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = true;
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

State { fsm: Fsm::READ_CONFIG, csr_wr_req, csr_wr_req_valid, conf_cnt: CSR_REQS_MAX, ..zero!<State>() }
Expand Down Expand Up @@ -382,7 +382,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = all_collected;
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

State {
Expand All @@ -405,7 +405,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = (fh_resp_valid);
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

let fsm = match (fh_resp_valid, error) {
Expand Down Expand Up @@ -433,7 +433,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = (bh_resp_valid);
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

let fsm = match (bh_resp_valid, error, bh_resp.header.btype) {
Expand Down Expand Up @@ -484,7 +484,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = (raw_resp_valid);
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

let fsm = match (raw_resp_valid, error, state.block_last) {
Expand Down Expand Up @@ -517,7 +517,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = (rle_resp_valid);
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(status),
value: status as Data,
};

let fsm = match (rle_resp_valid, error, state.block_last) {
Expand Down Expand Up @@ -566,7 +566,7 @@ proc ZstdDecoderInternal<
let csr_wr_req_valid = true;
let csr_wr_req = CsrWrReq {
csr: csr<LOG2_REGS_N>(Csr::STATUS),
value: checked_cast<Data>(ZstdDecoderStatus::IDLE),
value: ZstdDecoderStatus::IDLE as Data,
};

State { fsm: Fsm::IDLE, csr_wr_req, csr_wr_req_valid, ..zero!<State>() }
Expand Down

0 comments on commit 883f383

Please sign in to comment.