Skip to content

Instantly share code, notes, and snippets.

@ikwzm
Created March 30, 2012 11:09
Show Gist options
  • Save ikwzm/2250826 to your computer and use it in GitHub Desktop.
Save ikwzm/2250826 to your computer and use it in GitHub Desktop.
Mersenne Twister Pseudo Random Number Generator for Altera FPGA

Mersenne Twister Pseudo Random Number Generator for Altera FPGA

Mersenne Twister Pseudo Random Number Generator (https://gist.github.com/2146081) を Altera社のFPGAを使って論理合成とシミュレーションするための覚え書きです。

GHDL=ghdl
GHDLFLAGS =--ieee=synopsys -fexplicit --mb-comments
GHDLRUNFLAGS=--ieee=synopsys -fexplicit --mb-comments
WORK=work
TEST_BENCH = test_bench \
$(END_LIST)
all: $(TEST_BENCH)
clean:
rm -f *.o *.cf $(TEST_BENCH)
test_bench: mt19937ar.o test_bench.o
$(GHDL) -e $(GHDLFLAGS) $@
-$(GHDL) -r $(GHDLRUNFLAGS) $@
test_bench.o : ./test_bench.vhd mt19937ar.o mt32_gen.o
$(GHDL) -a $(GHDLFLAGS) --work=work $<
mt19937ar.o : ./mt19937ar.vhd
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
mt32_gen.o : ./mt32_gen.vhd mt32_1w1r_ram.o sdpram.o sdpram_altera_auto_select.o
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
mt32_1w1r_ram.o: ./mt32_1w1r_ram.vhd
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
sdpram.o : ./sdpram.vhd
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
sdpram_altera_auto_select.o : ./sdpram_altera_auto_select.vhd altera_mf.o
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
altera_mf.o : altera_mf.vhd altera_mf_components.o
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
altera_mf_components.o : altera_mf_components.vhd
$(GHDL) -a $(GHDLFLAGS) --work=$(WORK) $<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment