# How to pre-define the clock period in vhdl coding itself?

Status
Not open for further replies.

#### deepthi.reddy.912

##### Newbie level 5
Hi,

Is there any possibility to pre-define the clock period in vhdl coding itself so that the code will be synthesized with that frequency.

I have used the following piece of code but it is showing error.

architecture arch1 of controlckt is

signal Q,Q1,Q2,Q3,Q4 : std_logic := '0';
signal t: std_logic := '1';
--constant clk_period : time := 50 ns; --How to select the clock period correctly
begin
NET clock PERIOD := 5 ns ; -- showing error
process(clk)
begin

The input clock in the circuit is 100ns 50% duty cycle.

I want output clock period that is to be synthesized at 5ns. Is there any means for that?

#### TrickyDicky

No. Timing constraints have to be added in the appropriate file type depending on your synthesisor.

You can set up clocks in testbenches though, but not synthesis. Clock periods would have no use in synthesis anyway.

#### permute

This is more similar to how altera and synopsys do things. IMO, it makes more sense. I always have issues with UCF files because a net gets removed or renamed in synthesis and suddenly MAP errors out. When the synthesis tool is able to generate the UCF, it knows what it renamed the net to, or if it removed it. SDC also allows for some TCL scripting.

Clock periods do have a use in synthesis because synthesis does optimizations. Knowing which paths are slow vs fast allows the synthesis tool to make good decisions about area/speed tradeoffs.

But it looks like you want a clock synthesizer -- something like a PLL. These cannot be inferred. I suggest coregen or an instance of the correct PLL/DCM primitive.

#### Alexium

##### Full Member level 2
Xilinx ISE allows specifying constraints in VHDL file using attributes. I use it for clock signals that are generated inside the module and are not present in the interface.
Is this what you need?

Code:
[syntax=vhdl]attribute period: string;
signal clk:std_logic:
attribute period of clk : signal is “20 ns”;[/syntax]

Last edited:

#### deepthi.reddy.912

##### Newbie level 5
I am using wave-pipelining on FIR Filter. Usually in non-pipelining and pipelining only maximum combinational path delay is considered. I got this from Xilinx synthesizer and timing anlyzer as 10.836ns.

But in wave-pipelining, we consider (minimum clock period>= (max path delay -min path delay)+uncertainity);
I got this as 5ns;

How can i use this as a input from vhdl coding to set the minimum clock period for oeration of the circuit?

I hope i am clear. Kindly help.

Status
Not open for further replies.