Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to achieve this pulse timing in VHDL code

Status
Not open for further replies.
There should be a clock of known frequency, isn't it?
 

Hi,

Yes. right. I am using the base clock oscillator of 16Mhz. 1/16 Mhz = 62.5 ns.

thanks,
V. Prakash
 

then its just a simple matter of using a counter.....
 

Hi,

Yes.
regarding that Dval --> we can use a counter output to generate 0.5 usec ON and 0.5 usec OFF and so on.
Regarding that LVal --> That ON pulse duration is 256 usec and the OFF pulse duration is 744 usec. How to do this?
please let me know.

Thanks,
V. Prakash
 

Hi,

Thanks. i will try to generate that pulse with different counter.

Thanks,
V. Prakash
 

Hi, prakashvenugopal.
pls, see vhdl code below... and testbench...
1. i do not understand what you do with DATA???
2. and which edge of dval going with lval?? see comment in the code.
excuse me on my ENGLISH......


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
 
entity ex00 is
    Port ( clk : in  STD_LOGIC;
              reset : in  STD_LOGIC;
           lval : out  STD_LOGIC;
           dval : out  STD_LOGIC);
end ex00;
 
architecture Behavioral of ex00 is
 
signal count_div_16 : std_logic_vector(3 downto 0);
signal count_1000   : integer range 0 to 999;
 
begin
 
clk_div_16 : process(clk, reset)
     begin
       if reset = '0' then
            count_div_16 <= (others => '0');
       elsif (clk='1' and clk'event) then
            count_div_16 <= count_div_16 + "1";
       end if;
end process; 
 
cntr_1000 : process(count_div_16(3), reset)
    begin
        if reset = '0' then 
            count_1000 <= 0;
        elsif falling_edge(count_div_16(3)) then --rising_edge???
            if count_1000 = 999 then 
                count_1000 <= 0;
            else 
                count_1000 <= count_1000 + 1;
            end if;
        end if;
end process;
 
dval <= count_div_16(3);
lval <= '1' when (0 <= count_1000 and count_1000 < 256) else '0';
 
end Behavioral;




Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
 
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
 
ENTITY ex00_tb IS
END ex00_tb;
 
ARCHITECTURE behavior OF ex00_tb IS 
 
    -- Component Declaration for the Unit Under Test (UUT)
 
    COMPONENT ex00
    PORT(
         clk : IN  std_logic;
            reset : IN  std_logic;
         lval : OUT  std_logic;
         dval : OUT  std_logic
        );
    END COMPONENT;
    
 
   --Inputs
   signal clk : std_logic := '0';
    signal reset : std_logic := '0';
 
    --Outputs
   signal lval : std_logic;
   signal dval : std_logic;
 
   -- Clock period definitions
   constant clk_period : time := 62.5 ns;
 
BEGIN
 
    -- Instantiate the Unit Under Test (UUT)
   uut: ex00 PORT MAP (
          clk => clk,
             reset => reset,
          lval => lval,
          dval => dval
        );
 
   -- Clock process definitions
   clk_process :process
   begin
        clk <= '0';
        wait for clk_period/2;
        clk <= '1';
        wait for clk_period/2;
   end process;
 
 
   -- Stimulus process
   stim_proc: process
   begin        
      -- hold reset state for 100 ns.
      wait for 100 ns;  
        reset <= '1';
 
      wait for clk_period*10;
 
      -- insert stimulus here 
 
      wait;
   end process;
 
END;

 

Hi,

1. i do not understand what you do with DATA??? ---> I have to generate these two LVAL and DVAL only from FPGA and fed to the controller
2. and which edge of dval going with lval?? see comment in the code. --- falling edge of dval going with lval. when lval is get raised, the dval have to fall low.


I had created the rtl schematic for the vhdl code which you had sent. Please refer. I am not clear in it. Can you Please explain the rtl schematic of it. This code will achieve: Line valid(LVAL) ---> On time= 256 usec and OFF time = 744 usec continuously ?
Data Valid(Dval) ---> --- falling edge of dval going with lval raising (On time = 0.5 usec and Off time = 0.5 usec) continuously?

Thanks,
V. Prakash


https://obrazki.elektroda.pl/39_1320924416.jpg
 

Hi.......

1.
Line valid(LVAL) ---> On time= 256 usec and OFF time = 744 usec continuously ?
yes.......

2.
Data Valid(Dval) ---> --- falling edge of dval going with lval raising (On time = 0.5 usec and Off time = 0.5 usec) continuously?
yes.......

3.
I had created the rtl schematic for the vhdl code which you had sent.
how you had created???? which tool you made it from??? and i do not understand this RTL because LOW resolution image........

4. here is RTL from Xilinx ISE 13.2



5. you may to compile and simulate my code, and see timings and signal edges from simulation....

thnx......
 
Last edited:

Hi,

1) how you had created???? which tool you made it from??? and i do not understand this RTL because LOW resolution image........

I had created the rtl schematic using Xilinx ISE 10.1.3. Please check this one which i attached.

2)here is RTL from Xilinx ISE 13.2

signals in the Schematic which you posted doesnt match your vhdl code. Refere that, which you attached schematic is matching with the vhdl code which you posted,? Please let me know.

Thanks,
V. Prakash

https://obrazki.elektroda.pl/98_1320992944.jpg
 

I had created the rtl schematic using Xilinx ISE 10.1.3. Please check this one which i attached.
is yuor rtl refer to my vhdl????????????

signals in the Schematic which you posted doesnt match your vhdl code. Refere that, which you attached schematic is matching with the vhdl code which you posted,? Please let me know.
:) :) :) ........ my rtl refers to my vhdl, and greated from xilinx ise..........

please compile and simulate my code, and do rtl from xilinx 10.1.3..............
 

HI,

The image that i attached is the RTL shematic created from Xilinx ISE 10.1.3. I dont know why your rtl schematic doesnt match my rtl schematic and also refer that there are many signals like madd_count is not used in the vhdl code you posted. refer that.

check this for how i created that rtl:
In xilinx ISE 10.1.3 project nagivator --> in process window --> synthesize- XST option --> under view rtl schematic to obtain rtl schematic

Thanks,
V. Prakash
 

:lol::lol::lol:

I dont know why your rtl schematic doesnt match my rtl schematic
i know.... you are working with version 10.1, but i am working with 13.2........

there are many signals like madd_count is not used in the vhdl code you posted.
xilinx ISE made these signals itself like madd_count........

check this for how i created that rtl:
In xilinx ISE 10.1.3 project nagivator --> in process window --> synthesize- XST option --> under view rtl schematic to obtain rtl schematic
i do not know how it is working in version 10.1...... but i think you are in right way......


1. have you made compilation?
2. have you made simulation?
3. is it working according to your reuqest (timing diagrammm) ???????
 

Hi,

Yes. I am able to implement the design and generate the programming file. Actually before i had used Spartan 3A Evaluation Kit(XC3S400A). It had some issue in it while programming the .bit file. so i had sent that for replacement and also i am designing my own hardware with Spartan 3AN XC3S50AN for my application. I will check that two pulse in the board when i got a replacement board and let you know the output of it.

But in the mean time, i am not clear in that rtl schematic. If i have to change that
LVAL Pulse duration as On time= 844.8 usec and OFF time = 145.2 usec
DVAL pulse duration as ON time = 1.65 usec and OFF time = 1.65usec. How to change this in the above vhdl code? How to achieve this?

Please let me know.

Thanks,
V. Prakash

refer this attachment:
https://obrazki.elektroda.pl/32_1321094376.jpg
 

Hi,

Yes. The base clock oscillator of 16Mhz. 1/16 Mhz = 62.5 ns.


Thanks,
V. Prakash
 

Hi,

Able to achieve this timing:
LVAL Pulse duration as On time= 844.8 usec and OFF time = 145.2 usec
DVAL pulse duration as ON time = 1.65 usec and OFF time = 1.65usec.
How to change this in the above vhdl code or guide me if you able?

Thanks,
V. Prakash
 

Hi denesio,

Able to achieve this timing using the above code. guide me.

Thanks,
V. Prakash
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top