aboutsummaryrefslogtreecommitdiffstats
path: root/tests/asicworld/code_verilog_tutorial_counter.v
blob: 10ca00df462064b0b568bbd12ca291c1dcfc1054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//-----------------------------------------------------
// Design Name : counter
// File Name   : counter.v
// Function    : 4 bit up counter
// Coder       : Deepak
//-----------------------------------------------------
module counter (clk, reset, enable, count);
input clk, reset, enable;
output [3:0] count;
reg [3:0] count;                                   

always @ (posedge clk)
if (reset == 1'b1) begin
  count <= 0;
end else if ( enable == 1'b1) begin
  count <= count + 1;
end

endmodule  
s="c"># Utilizes the lxdialog package # object files used by all kconfig flavours # Platform specific fixes # # FreeBSD export CFLAGS+=-DKBUILD_NO_NLS conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \ .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c all: conf mconf lxdialog/lxdialog lxdialog/lxdialog: $(MAKE) -C lxdialog conf: $(conf-objs) mconf: $(mconf-objs) clean: rm -f *.o $(clean-files) conf mconf $(MAKE) -C lxdialog clean zconf.tab.o: lex.zconf.c zconf.hash.c confdata.c kconfig_load.o: lkc_defs.h lkc_defs.h: $(src)/lkc_proto.h sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' zconf.tab.c: zconf.y lex.zconf.c: zconf.l zconf.hash.c: zconf.gperf %.tab.c: %.y cp $@_shipped $@ || bison -l -b $* -p $(notdir $*) $< lex.%.c: %.l cp $@_shipped $@ || flex -L -P$(notdir $*) -o$@ $< %.hash.c: %.gperf cp $@_shipped $@ || gperf < $< > $@