# Negative widths and offsets

Hi,

I’m just looking for a slight clarification of the meaning of negative offsets and widths. As for offset, the help file says “The offset from a rising clock edge to a glitch pulse rising edge, as a percentage of one period.” Would negative offset correspond to the second half of the clock cycle, meaning when the clock signal is low?

As for negative widths, the help file says “Note that negative widths are allowed; these act as if they are positive widths on the other half of the clock cycle.” So what happens when if you have a positive offset but a negative width? Does it mean that if I want to insert a glitch during the second half of the clock cycle, both width and offset need to be negative?

Thanks!

In the above image, offset moves the rising edge of #1 relative to clk_src and width moves the falling edge relative to the rising edge. A negative width will move the width edge behind the offset edge, making the width edge rising and the offset edge falling. I’d recommend ignoring negative widths as you can recreate the same glitch by reducing your offset.

A negative offset value will put the glitch on the negative half of the clock cycle.

Ah, now I see. Thank you very much! Very clarifying.

Just to make sure I understand negative widths and negatives offset correctly in the context of clock glitching:

• All kind of clock glitches can be performed without using negative width
• negatives widths are redundant
• as an example width=1%;offset=-2% will produce exactly the same glitch as width=-1%;offset=-1%
• or in general width=w;offset=o will produce exactly the same glitch as width=-w;offset=o+w

If someone could confirm my statements above are correct, my question is answered.

Though if my above statements are correct I am wondering why were negative widths even introduced. They have no use and they seem to confuse people.

Yeah, you’re correct about negative widths being redundant.

They weren’t really introduced per se, that’s just how the underlying hardware block works. We could stop people from setting negative widths, but I don’t see too much reason in changing this at this point in the Lite/Pro lifecycle.

Thanks for the clarification!

While we are already talking about widths on CW-Lite: A width of 0% is not actually zero, i.e. no glitch; it is the smallest width the hardware can produce. Is that correct?

0 width/offset are undefined behaviour - ideally they would actually be zero, but there’s propagation delay between different hardware blocks that make it slightly off. We just warn the end user instead of throwing an error as it would be kind of annoying to have an invalid point in the middle of your width/offset range.

Alex

Thanks for the answers! In the future I will only scan widths in the range (0, 49.609375] .

1 Like