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
''' | |
Created on 14 Mar 2015 | |
@author: Josy | |
''' | |
from __future__ import print_function | |
import os, random | |
from myhdl import * |
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 myhdl import * | |
def mpegChannel(clk, rst, s_tx_data_xor_mask_r): | |
# table = tuple([9,8,7,6]) | |
@always_seq(clk.posedge, reset=rst) | |
def fsm_seq(): | |
for i in range(4): | |
# s_tx_data_xor_mask_r.next[(i+1)*8:i*8] = table[i] |
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 __future__ import print_function | |
import random | |
from myhdl import * | |
def m_top_const(COEF, N, clock, reset, a, b, x, y): | |
v = [Signal(x.val) for _ in range(N-1)] |
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
''' | |
Created on 18 May 2015 | |
@author: Josy | |
''' | |
from __future__ import print_function | |
from myhdl import * |
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
''' | |
Created on 27 Mar 2015 | |
@author: Josy | |
''' | |
import os | |
from myhdl import * | |
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
-- File: aos.vhd | |
-- Generated by MyHDL 1.0dev | |
-- Date: Mon Aug 31 15:57:52 2015 | |
library IEEE; | |
use IEEE.std_logic_1164.all; | |
use IEEE.numeric_std.all; | |
use std.textio.all; |
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
def array_3(clk, reset, Sel1, Sel2, Q): | |
''' testing a 2-dimensional Constant Array | |
''' | |
aoc = myhdl.Array( [[1,2,3], [4,5,6], [7,8,9]], myhdl.intbv(0)[len(Q):]) | |
@myhdl.always_seq( clk.posedge, reset = reset) | |
def rtlreg(): | |
Q.next = aoc[Sel2][Sel1] | |
return rtlreg |
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
def array_2(clk, reset, D, Q): | |
''' testing a 2-dimensional Array | |
just making a simple pipeline | |
''' | |
mt = myhdl.Array( (4, 3,), myhdl.Signal( myhdl.intbv(0)[len(D):])) | |
@myhdl.always_comb | |
def rtlcomb(): | |
Q.next = mt[3][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
def delta(Clk, Reset, D, Wr, Sel, Q): | |
r = [Signal( intbv(0)[len(D):]) for _ in range(9)] | |
@always_seq(Clk.posedge, reset = Reset) | |
def rtl(): | |
if Wr: | |
r[0].next = D | |
r[1].next = r[0] | |
r[2].next = r[1] | |
r[3].next = r[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
''' | |
Created on 2 Jul 2016 | |
@author: Josy | |
a question by Merkourios Katsimpris on gitter:myhdl triggered me to look at | |
http://paddy3118.blogspot.nl/2008/08/zig-zag.html | |
while the solution presented there is (very probably) very pythonic | |
you need to read the explanation to understand what or why it is doing |
OlderNewer