Blog post about hashtable

24 views
Skip to first unread message

adamwa...@gmail.com

unread,
Sep 15, 2021, 8:23:45 AM9/15/21
to Clash - Hardware Description Language

Hi Clash people,

I've written a blog post that you might find interesting: http://adamwalker.github.io/Building-FPGA-KVS/.

Questions and comments are very welcome.

Cheers,
Adam

Christiaan Baaij

unread,
Sep 17, 2021, 5:53:34 AM9/17/21
to clash-l...@googlegroups.com
Hi Adam,

Great post! Really appreciate all the background detail.
One minor comments:

The type signature for cuckooPipelineInsert
It would be nice if it was formatted such that I wouldn't need horizontal scrolling when reading on a desktop (I understand this can't be avoided on mobile)
If you use (fu)ormulu style formatting this is easier to achieve:

{- |
Convenience wrapper for cuckooPipeline that checks whether keys are present
before inserting them. If found, it does a modification instead.
  
Only allows one insertion at a time so it is less efficient for inserts than `cuckooPipeline`
-}
cuckooPipelineInsert ::
    forall dom m n numRamPipes k v .
    (HiddenClockResetEnable dom, KnownNat n, Eq k, KnownNat m, NFDataX k, NFDataX v) =>
    -- | Number of ram read pipeline stages
    SNat numRamPipes ->
    -- | Hash functions for each stage             
    Vec (m + 1) (k -> Unsigned n) ->
    -- | Key to lookup, modify or insert
    Signal dom k ->
     -- | Modification. Nothing == no modification. Just Nothing == delete.
    -- Just (Just X) == insert or overwrite existing value at key         
    Signal dom (Maybe (Maybe v)) ->
     -- | (Lookup result, Combined busy signal)
    ( Signal dom (Maybe v), -- Lookup result
    , Signal dom Bool       -- Combined busy signal
    )                           

--
You received this message because you are subscribed to the Google Groups "Clash - Hardware Description Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clash-languag...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/75baf904-5322-4347-ad92-7064c9e9a473n%40googlegroups.com.

adamwa...@gmail.com

unread,
Sep 20, 2021, 1:06:39 AM9/20/21
to Clash - Hardware Description Language
Reformatted. Thanks for the suggestion!
Reply all
Reply to author
Forward
0 new messages