EmbDev.net

Forum: FPGA, VHDL & Verilog How to generate a few clocks at ModelSim


von Electrical_Student (Guest)


Rate this post
useful
not useful
Hello everyone,
I'm trying to write a simple program in vhdl that is based on clock.
When I have a rising edge of the clock , i want to get at the out bit a 
and b. And when I have falling _edge I want to get 0 at the output.
But when I run it in Modelsim program I see only one clock.
How can i see few clocks (for example 10 clocks)
Thank you very much.
I wrote the following code:
1
library ieee;
2
use ieee.std_logic_1164.all;
3
entity D_flip is
4
port( 
5
a: in std_logic;
6
b: in std_logic;
7
clk: in std_logic;
8
q:out std_logic
9
10
);
11
end D_flip;
12
13
14
architecture flip of D_flip is
15
16
begin
17
process(clk)
18
begin
19
if rising_edge(clk) then
20
q<=a and b;
21
if falling_edge(clk) then
22
q<='0';
23
end if;
24
end process;
25
end flip;

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
How does the test bench look like?

Electrical_Student wrote:
> D_flip
A D-flipflop is not sensitive to both clock edges.

von Gerhard H. (ghf)


Rate this post
useful
not useful
... unless it is in a Xilinx Coolrunner, for example.

Gerhard

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Gerhard H. wrote:
> ... unless it is in a Xilinx Coolrunner, for example.
The last of its kind.

X states explicitly: "DualEDGE flip-flops", they don't claim those very 
special flipflops to be simple D-flipflops.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.