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

Render CompDecl in VHDL decl function (copy #2819) #2825

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Oct 9, 2024

Instead of rendering them in inst_. I noticed that while creating a primitive that when I used a combination of compInBlock and instDecl Empty that the entire block declaration and its declarative part were elided; leaving only the portmap.

So before this change, the following primitive declaration:

  = do
    plusFloatInstName <- Id.makeBasic "plusFloat_inst"

    let
      compInps =
        [ ("clk", N.Bit)
        , ("arg1", DSL.ety a)
        , ("arg2", DSL.ety b) ]
      compOuts =
        [ ("dout", DSL.ety result) ]

      plusFloatName = "plusFloat"

    DSL.declaration "plusFloat_inst_block" $ do
      DSL.compInBlock "plusFloat" compInps compOuts

      let
        inps =
          [ ("clk", clk )
          , ("arg1", a)
          , ("arg2", b)
          ]

        outs =
          [ ("dout", result)
          ]

      DSL.instDecl Empty (Id.unsafeMake plusFloatName) plusFloatInstName
        [] inps outs

would get translated to:

    plusFloat_inst : plusFloat
      port map
        ( clk  => clk
        , arg1 => y
        , arg2 => z
        , dout => \c$app_arg\ );

instead of the expected:

  plusFloat_inst_block : block
    component plusFloat port
      ( clk : in std_logic
      ; arg1 : in std_logic_vector(31 downto 0)
      ; arg2 : in std_logic_vector(31 downto 0)
      ; dout : out std_logic_vector(31 downto 0) );
    end component;
  begin
    plusFloat_inst : plusFloat
      port map
        ( clk  => clk
        , arg1 => y
        , arg2 => z
        , dout => \c$app_arg\ );


  end block;

Still TODO:

  • Check copyright notices are up to date in edited files

This is an automatic copy of pull request #2819 done by [Mergify](https://mergify.com).

Instead of rendering them in `inst_`. I noticed that while creating
a primitive that when I used a combination of `compInBlock` and
`instDecl Empty` that the entire block declaration and its
declarative part were elided; leaving only the portmap.

(cherry picked from commit 4cc4044)
@DigitalBrains1
Copy link
Member

Should we perhaps add a short Changelog message? (This will need another PR on master with another backport to not confuse us when we release the next version of Clash.)

@christiaanb
Copy link
Member

Adding a changelog entry is tracked as: #2838

@christiaanb christiaanb merged commit 435c4a9 into 1.8 Nov 2, 2024
17 checks passed
@christiaanb christiaanb deleted the mergify/copy/1.8/pr-2819 branch November 2, 2024 06:39
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.

2 participants