Skip to content

Conversation

@mprse
Copy link
Contributor

@mprse mprse commented Aug 1, 2019

This PR adds Verilog implementation for FPGA Timer which can be used in two modes:

  • Timer to measure the elapsed time,
  • CountDownTimer to generate the programmed delays.

The accuracy of the FPGA Timer is 10 ns: 1 timer tick corresponds to 10 ns.

The mbed OS part of the PR:
ARMmbed/mbed-os#11147

end else begin
counter <= count_down_value;
end
end else begin
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
end else begin
end else begin

Wrong indentation.

rtl/timer.v Outdated

// Timer module
//
// This module counts elapsed time or perform the delay
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This module counts elapsed time or perform the delay
// This module counts elapsed time or performs the delay

rtl/timer.v Outdated
end
end else begin
if (mode == MODE_TIMER) begin
if (enable == 1'b1) begin
Copy link
Member

Choose a reason for hiding this comment

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

Current code increments the counter whenever the enable pin is high. This is OK, however I'd like to see a setting that would modify this behavior so the measurement would stop on the first falling edge. This way we could choose to measure the sum of enable high states or just the first pulse.

@fkjagodzinski
Copy link
Member

Starting CI.

@0xc0170
Copy link

0xc0170 commented Oct 18, 2019

@mprse Can we proceed to unblock Mbed OS PR ?

@mprse
Copy link
Contributor Author

mprse commented Oct 18, 2019

@mprse Can we proceed to unblock Mbed OS PR ?

@fkjagodzinski Are you happy with the last changes?

@fkjagodzinski
Copy link
Member

@fkjagodzinski Are you happy with the last changes?

What changes? Nothing has changed since my review.

@mprse
Copy link
Contributor Author

mprse commented Oct 21, 2019

What changes? Nothing has changed since my review.
Sorry, I forgot to push the updates.

I added the requested option, to count only the first pulse.

@mprse Can we proceed to unblock Mbed OS PR ?

Even with this one is merged. PR ARMmbed/mbed-os#11147 will have to wait for the FPGA-test-shield firmware version update and this is planned next year I think.

@0xc0170
Copy link

0xc0170 commented Oct 23, 2019

Even with this one is merged. PR ARMmbed/mbed-os#11147 will have to wait for the FPGA-test-shield firmware version update and this is planned next year I think.

Dang, that is far way. We shall close 11147 and keep in opened in jira as internal ticket with branch available to continue this work the next year?

Copy link
Member

@fkjagodzinski fkjagodzinski left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

Comment on lines 75 to 82
if (mode == MODE_TIMER) begin
if (enable == 1'b1 && count_once_reg == 1'b1) begin
counter <= counter + 1;
end

if (count_once == 1'b1 && negedge_enable == 1'b1) begin
count_once_reg <= 1'b0;
end
Copy link
Member

Choose a reason for hiding this comment

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

I found the count_once_reg name a bit misleading as I assumed a not-inverted logic here. Consider renaming to something like counting_enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@mprse mprse merged commit f69c6c3 into ARMmbed:master Oct 28, 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.

3 participants