Documentation

Sparkle.Core.Vector

structure Sparkle.Core.Vector.HWVector (α : Type) (n : Nat) :

Hardware vector with compile-time known size.

This is a wrapper around an array that carries its size in the type, making it suitable for hardware synthesis.

Instances For
    def Sparkle.Core.Vector.HWVector.ofArray {α : Type} {n : Nat} (arr : Array α) (h : arr.size = n := by rfl) :

    Create a vector from an array (checks size at runtime)

    Equations
    Instances For
      def Sparkle.Core.Vector.HWVector.get {α : Type} {n : Nat} (v : HWVector α n) (i : Fin n) :
      α

      Get element at index i

      Equations
      Instances For
        def Sparkle.Core.Vector.HWVector.set {α : Type} {n : Nat} (v : HWVector α n) (i : Fin n) (val : α) :

        Set element at index i

        Equations
        Instances For
          def Sparkle.Core.Vector.HWVector.replicate {α : Type} (n : Nat) (val : α) :

          Create a vector by replicating a value

          Equations
          Instances For
            def Sparkle.Core.Vector.HWVector.map {α β : Type} {n : Nat} (f : αβ) (v : HWVector α n) :

            Map a function over all elements

            Equations
            Instances For

              Create vector from list (checks size)

              Equations
              Instances For
                def Sparkle.Core.Vector.HWVector.toList {α : Type} {n : Nat} (v : HWVector α n) :
                List α

                Convert vector to list

                Equations
                Instances For