vistaでquartus その18


概要

vistaでquartusやってみた。
polyphonyでserialしてみた。
zundokoやってみた。

環境

windows vista 32bit
quartus ii v13.0
polyphony v0.3.6
ep2c5t144ボード

写真

サンプルコード

from polyphony import testbench, module, is_worker_running
from polyphony.timing import clksleep
from polyphony.io import Port
from polyphony.typing import bit, uint8

@module
class zundoko:
    def __init__(self):
        self.data = Port(uint8, 'out', init = 0)
        self.start = Port(bit, 'out', init = 0)
        self.append_worker(self.worker)
    def _wait(self):
        for i in range(100000):
            pass
    def send(self, c:uint8):
        self.data(c);
        self.start(1)
        clksleep(1)
        self.start(0)
        self._wait()
    def worker(self):
        i:uint8 = 0
        n:uint8 = 0
        r:uint8 = 234
        while is_worker_running():
            if (i < 1):
                if (n < 4):
                    r = r * 5 + 1
                    if (r < 127):
                        print("zun")
                        self.send(122)
                        self.send(117)
                        self.send(110)
                        self.send(32)
                        n = n + 1
                    else:
                        print("doko");
                        self.send(100)
                        self.send(111)
                        self.send(107)
                        self.send(111)
                        self.send(32)
                        n = 0
                else:
                    print("doko kiyosi!!")
                    self.send(100)
                    self.send(111)
                    self.send(107)
                    self.send(111)
                    self.send(32)
                    self.send(107)
                    self.send(105)
                    self.send(121)
                    self.send(111)
                    self.send(115)
                    self.send(105)
                    self.send(33)
                    self.send(33)
                    i = i + 1

m = zundoko()





verilogコード

module test2(input clk, input rst, output tx);
    wire [7:0] data;
    wire start;
    tx2 tx2(.clk(clk), .rst(rst), .start(start), .data(data), .tx(tx), .busy(busy), .get(get));
    zundoko_m m(.clk(clk), .rst(rst), .data(data), .start(start));
endmodule

以上。