Skip to content

Instantly share code, notes, and snippets.

@ngzh
ngzh / streamTransactionExtenderPlusAndExampleTB.scala
Created May 16, 2022 19:47
streamTransactionExtenderPlusAndExampleTB
package mylib
import spinal.core._
import spinal.lib._
import spinal.core.sim._
import spinal.lib.sim._
import scala.util.Random
class StreamTransactionExtender2[T <: Data, T2 <: Data](dataType: HardType[T],
outDataType: HardType[T2],
@ngzh
ngzh / StreamTransactionExtender2_implementation_and_testbench.scala
Last active May 16, 2022 19:46
StreamTransactionExtender2_implementation_and_testbench
package mylib
import spinal.core._
import spinal.lib._
import spinal.core.sim._
import spinal.lib.sim._
import scala.util.Random
/* Extend one input transfer into serveral outputs, io.count represent delivering output (count + 1) times. */
class StreamTransactionExtender2[T <: Data, T2 <: Data](dataType: HardType[T],
@ngzh
ngzh / package.part.el
Last active September 3, 2016 10:08
modifed package-menu--find-upgrades
;; see line 19-24
(defun package-menu--find-upgrades ()
(let (installed available upgrades)
;; Build list of installed/available packages in this buffer.
(dolist (entry tabulated-list-entries)
;; ENTRY is (PKG-DESC [NAME VERSION STATUS DOC])
(let ((pkg-desc (car entry))
(status (aref (cadr entry) 2)))
(cond ((member status '("installed" "unsigned"))
(push pkg-desc installed))
@ngzh
ngzh / inspect_input.py
Created July 20, 2016 07:00
a simple inspector for raw input sequence, watch output useing `tail -f /tmp/raw_sequence_input`, for detail see http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/
# Copyright (c) 2011 Joshua D. Bartlett
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in