Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Add generic bound
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Aug 28, 2024
1 parent b0e9a9a commit 5e3caab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/async_fifo/async_fifo.veryl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import async_fifo_pkg::calc_default_depth;
///
/// Asynchronous FIFO based on gray-code pointer.
/// Generic parameter `S` is a module name of synchrinozer.
pub module async_fifo::<S> #(
pub module async_fifo::<S: synchronizer> #(
param WIDTH : u32 = 8 , /// Data width
param TYPE : type = logic<WIDTH> , /// Data type
param STAGES : u32 = 2 , /// Stages of synchronizer
Expand Down
2 changes: 1 addition & 1 deletion src/async_fifo/async_fifo_reset_sync.veryl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module async_fifo_reset_sync::<S> #(
module async_fifo_reset_sync::<S: synchronizer> #(
param MERGE_RESET : bit = '0,
param RESET_SYNC_STAGES: u32 = 2 ,
) (
Expand Down
2 changes: 1 addition & 1 deletion src/async_handshake/async_handshake.veryl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Asynchronous data transmitter based on handshake protocol.
/// Generic parameter `S` is a module name of synchrinoizer.
pub module async_handshake::<S> #(
pub module async_handshake::<S: synchronizer> #(
param WIDTH : u32 = 8 , /// Data width
param TYPE : type = logic<WIDTH>, /// Data type
param STAGES : u32 = 2 , /// Stages of synchrinoizer
Expand Down
9 changes: 9 additions & 0 deletions src/synchronizer/synchronizer.veryl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub proto module synchronizer #(
param WIDTH : u32 = 8,
param STAGES: u32 = 2,
) (
i_clk: input clock,
i_rst: input reset,
i_d : input logic,
o_d : output logic,
);

0 comments on commit 5e3caab

Please sign in to comment.