aboutsummaryrefslogtreecommitdiffstats
path: root/tests/asicworld/code_tidbits_reg_seq_example.v
blob: 458c87927442bb5d13f2da1dbfaf0018f53a051c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module reg_seq_example( clk, reset, d, q);
input clk, reset, d;
output q;
  
reg   q;
wire clk, reset, d;

always @ (posedge clk or posedge reset)
if (reset) begin
  q <= 1'b0;
end else begin
  q <= d;
end

endmodule
e.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  ADM5120 specific early printk support
 *
 *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 *
 */

#include <linux/init.h>
#include <linux/io.h>

#include <asm/addrspace.h>
#include <asm/mach-adm5120/adm5120_defs.h>
#include <asm/mach-adm5120/adm5120_uart.h>

#define UART_READ(r) \
	__raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
#define UART_WRITE(r, v) \
	__raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))

void __init prom_putchar(char ch)
{
	while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)
		;
	UART_WRITE(UART_REG_DATA, ch);
	while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0)
		;
}