Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DV/HMAC] hmac support config blocking and wr key #1023

Merged
merged 1 commit into from Nov 21, 2019

Conversation

cindychip
Copy link
Contributor

@cindychip cindychip commented Nov 20, 2019

This PR supports the changes in #1014
Support config blocking during msg_wr: during valid msg_wr, if trying to
update the config register, it will be discarded
Support err code when wr_key during msg_wr

Signed-off-by: Cindy Chen chencindy@google.com

@cindychip cindychip force-pushed the hmac_support_block_config branch 2 times, most recently from 89d10ce to a87041d Compare November 20, 2019 01:45
@@ -88,12 +88,40 @@ class hmac_base_vseq extends cip_base_vseq #(.CFG_T (hmac_env_cfg)
cfg_interrupts(.interrupts(interrupts), .enable(1'b1));
endtask

virtual task write_rand_config_and_key(bit do_wr_config, bit do_wr_key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we can call it like write_discarded_config_and_key, so that we know the task just do some dummy writes. Same for write_rand_config and write_rand_key

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, makes sense and updated!

@@ -184,6 +212,8 @@ class hmac_base_vseq extends cip_base_vseq #(.CFG_T (hmac_env_cfg)
if (ral.cfg.sha_en.get_mirrored_value()) begin
if (!do_back_pressure) check_status_intr_fifo_full();
else clear_intr_fifo_full();
// randomly change key, config regs during msg wr, should trigger error or be discarded
write_rand_config_and_key($urandom_range(0, 20) == 0, $urandom_range(0, 20) == 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add some delay before write_rand_config_and_key or do it in the task

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, that sounds right, thanks for the reminder.

// will gate the write process with wr_cnt_updated signal if user uses non-blocking mode
forever @(hmac_wr_cnt) begin
wr_cnt_updated = 0;
cfg.clk_rst_vif.wait_clks(HMAC_WR_WORD_CYCLE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, looks like we can move this wait to line 246, then we can remove this loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion to simply the code. Updated as you mentioned.

@cindychip cindychip force-pushed the hmac_support_block_config branch 3 times, most recently from aba2ff6 to e798d1d Compare November 20, 2019 19:36
Support config blocking during msg_wr: during valid msg_wr, if trying to
update the config register, it will be discarded
Support err code when wr_key during msg_wr
Separate hmac_wr_cnt in tl_process because it uses wait function
Signed-off-by: Cindy Chen <chencindy@google.com>
@cindychip cindychip merged commit 10a5d3b into lowRISC:master Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants