change register names to end in _reg
by convention
This commit is contained in:
parent
ec77559e2b
commit
e05c368688
4 changed files with 87 additions and 69 deletions
|
@ -17,15 +17,15 @@ fn blinky(clock_frequency: u64) {
|
|||
let max_value = clock_frequency / 2 - 1;
|
||||
let int_ty = UInt::range_inclusive(0..=max_value);
|
||||
#[hdl]
|
||||
let counter: UInt = reg_builder().clock_domain(cd).reset(0u8.cast_to(int_ty));
|
||||
let counter_reg: UInt = reg_builder().clock_domain(cd).reset(0u8.cast_to(int_ty));
|
||||
#[hdl]
|
||||
let output_reg: Bool = reg_builder().clock_domain(cd).reset(false);
|
||||
#[hdl]
|
||||
if counter.cmp_eq(max_value) {
|
||||
connect_any(counter, 0u8);
|
||||
if counter_reg.cmp_eq(max_value) {
|
||||
connect_any(counter_reg, 0u8);
|
||||
connect(output_reg, !output_reg);
|
||||
} else {
|
||||
connect_any(counter, counter + 1_hdl_u1);
|
||||
connect_any(counter_reg, counter_reg + 1_hdl_u1);
|
||||
}
|
||||
#[hdl]
|
||||
let led: Bool = m.output();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue