This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta, abstractmethod, abstractproperty | |
from asyncio import QueueEmpty | |
from collections import deque | |
from typing import ( | |
Callable, | |
Deque, | |
Generic, | |
Protocol, | |
Set, | |
Type, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Awaitable | |
from cocotb.triggers import Trigger, _Event | |
class Alert(Awaitable[None]): | |
def __init__(self) -> None: | |
self._pending = [] | |
def set(self) -> None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* simulator control (enums or separate functions?) | |
* SHUTDOWN | |
* RESTART (new addition) | |
* logging | |
* levels | |
* TRACE | |
* DEBUG | |
* INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- package containing a type-generic D Flip Flop | |
-- may not be 100% valid VHDL code, contact ktbarrett on gitter | |
-- non-generic version does synthesize correctly | |
package generic_pkg is | |
procedure generic_FF | |
generic ( | |
constant T: type) | |
paramater ( | |
signal q : out T; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import * | |
K_contra = TypeVar("K_contra", contravariant=True) | |
K_co = TypeVar("K_co", covariant=True) | |
V_co = TypeVar("V_co", covariant=True) | |
V = TypeVar("V") | |
T = TypeVar("T") | |
class ContravariantMapping(Protocol[K_contra, V_co]): | |
def __getitem__(self, __key: K_contra) -> V_co: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
from typing import Deque, Generic, Optional, TypeVar | |
from cocotb.triggers import Event | |
T = TypeVar("T") | |
class RecvFailed(Exception): | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Awaitable, Generic, TypeVar | |
from cocotb.triggers import Event | |
T = TypeVar("T") | |
class Signal(Generic[T]): | |
def __init__(self, __init_value: T) -> None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def test(dut): | |
with TaskManager() as tm: | |
@tm.fork | |
async def stimulate(): | |
pass # stimulate an interface | |
@tm.fork |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity piecewise_function is | |
generic ( | |
NODE_MAP : NodeMapType; | |
NODE_ID : string; | |
NUM_SEGMENTS : natural; | |
THRESHOLD_SIZE_RES : sfixed; | |
BIAS_SIZE_RES : sfixed; | |
GAIN_SIZE_RES : sfixed); | |
port ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library ieee; | |
use ieee.std_logic_1164.all; | |
package generic_ff_pack is | |
procedure FF | |
generic ( | |
type T) | |
parameter ( | |
signal q : out T; | |
constant d : in T; |