This file contains 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
#include <variant> | |
template <typename ...Args> | |
struct sum_; | |
template <typename Last> | |
struct sum_<Last> { | |
using type = Last; | |
}; |
This file contains 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 functools import cache, cached_property | |
from typing import ( | |
Collection, | |
Iterable, | |
Optional, | |
Reversible, | |
Sized, | |
TypeAlias, | |
TypeVar, | |
overload, |
This file contains 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 functools import lru_cache | |
from typing import Dict, Hashable, List, Optional, TypeVar | |
T = TypeVar("T", bound=Hashable) | |
def c3_linearize(dep_tree: Dict[T, List[T]], root: T) -> List[T]: | |
"""Linearize a dependency tree""" | |
@lru_cache(None) |
This file contains 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 Optional, Tuple, Union, overload | |
_time_unit_map = { | |
"ps": -12, | |
"ns": -9, | |
"us": -6, | |
"ms": -3, | |
"s": 0, | |
} |
This file contains 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
function logerr { | |
file="$1" | |
shift 1 | |
"$@" 2> >(tee "$file" >&2) | |
} |
This file contains 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; |
This file contains 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 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 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 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): | |
... |
NewerOlder