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 veriutils import ( | |
| check_intbv_signal, check_bool_signal) | |
| from myhdl import Signal, intbv, always_comb, always | |
| from math import log | |
| import numpy as np | |
| def FFTPermute(input_siglist, output_siglist, butterfly_index, | |
| clock_enable, clock): |
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
| import numpy as np | |
| import pyopencl as cl | |
| from pyopencl import tools as cl_tools | |
| from pyopencl import array as cl_array | |
| from pyopencl import clmath | |
| ctx = cl.create_some_context() | |
| queue = cl.CommandQueue(ctx) | |
| mf = cl.mem_flags |
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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #define N_SUBVALS 4 | |
| #define BOUNDARY 4 | |
| int main() | |
| { | |
| // The code finds the next boundary alignment for each set of of 4 |
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 myhdl import * | |
| class Interface(object): | |
| def __init__(self): | |
| self.foo = Signal(intbv(0)[20:]) | |
| self.bar = Signal(intbv(0)[20:]) | |
| @block | |
| def Foo(a, b, c, d, e, clock): |
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 myhdl import * | |
| import myhdl | |
| class Interface(object): | |
| def __init__(self): | |
| self.bar = Signal(intbv(0)[4:]) | |
| @block | |
| def block1(out_interface, foo): |
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 myhdl import * | |
| @block | |
| def block1(clock, input_signal, output_signal): | |
| @always(clock.posedge) | |
| def driver(): | |
| output_signal.next = input_signal | |
| return driver |
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 myhdl import * | |
| class Interface(): | |
| def __init__(self): | |
| self.data = Signal(False) | |
| class HDLClass1(object): | |
| @block |
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 myhdl import * | |
| @block | |
| def grant_selector(request, grant, request_bit): | |
| if request_bit == 0: | |
| @always_comb | |
| def selector(): | |
| grant.next = request[request_bit] |
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
| #ifndef CURIOUS_NETWORKING_H | |
| #define CURIOUS_NETWORKING_H | |
| static const size_t packet_len = 1395; | |
| static const char packet[] = { | |
| 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, 0x2c, 0x20, 0x34, 0x2c, 0x20, | |
| 0x35, 0x2c, 0x20, 0x36, 0x2c, 0x20, 0x37, 0x2c, 0x20, 0x38, 0x2c, 0x20, | |
| 0x39, 0x2c, 0x20, 0x31, 0x30, 0x2c, 0x20, 0x31, 0x31, 0x2c, 0x20, 0x31, | |
| 0x32, 0x2c, 0x20, 0x31, 0x33, 0x2c, 0x20, 0x31, 0x34, 0x2c, 0x20, 0x31, | |
| 0x35, 0x2c, 0x20, 0x31, 0x36, 0x2c, 0x20, 0x31, 0x37, 0x2c, 0x20, 0x31, |
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
| import numpy as np | |
| def empty_aligned(shape, dtype='float64', order='C', n=None): | |
| '''empty_aligned(shape, dtype='float64', order='C', n=None) | |
| Function that returns an empty numpy array that is n-byte aligned, | |
| where ``n`` is determined by inspecting the CPU if it is not | |
| provided. | |
| The alignment is given by the final optional argument, ``n``. If ``n`` is | |
| not set then the default alignment is used. | |
| The rest of the arguments are as per :func:`numpy.empty`. |