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

Verilog / VHDL code sample on hover for "extern" modules #35

Open
VonTum opened this issue Nov 26, 2024 · 0 comments
Open

Verilog / VHDL code sample on hover for "extern" modules #35

VonTum opened this issue Nov 26, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@VonTum
Copy link
Collaborator

VonTum commented Nov 26, 2024

When the user declares an extern module, their intention is to include some external Verilog or VHDL code.

It would be convenient if we would provide a Verilog or VHDL code sample for the interface of this extern module, such that the user can copy or verify it.

Example:

extern module MEMORY_M20K #(int WIDTH, int DEPTH_LOG2, bool FORCE_TO_ZERO) {
  domain clk
  
  interface write: bool writeEnable, int writeAddr, bool[WIDTH] dataIn
  
  interface read: bool readEnable, int readAddr -> bool[WIDTH] dataOut, bool eccStatus
} 

What the hover signature could then say is: (lifted straight from https://github.com/VonTum/Dedekind/blob/main/hardware/src/memory.v#L112C1-L129C3)

module MEMORY_M20K #(
    parameter WIDTH = 20,
    parameter DEPTH_LOG2 = 9,
    parameter FORCE_TO_ZERO = 1 // Force output to 0 when not readEnable
) (
    input clk,
    
    // Write Side
    input writeEnable,
    input[DEPTH_LOG2-1:0] writeAddr,
    input[WIDTH-1:0] dataIn,
    
    // Read Side
    input readEnable,
    input[DEPTH_LOG2-1:0] readAddr,
    output[WIDTH-1:0] dataOut,
    output eccStatus
);

This may be a bit of a complicated example, especially because it's parametrized (which is an open issue #25), but the basic point stands.

@VonTum VonTum added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant