• 39 Posts
  • 131 Comments
Joined 2 years ago
cake
Cake day: June 17th, 2023

help-circle

  • hardware26toFPGA@lemmy.mlHow can I improve this hacky SV assertion?
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    Both antecedent and consequent are sampled at preponed region. So assertion will not trigger at the edge where adc_data_en rises. This is the intention, since the value of adc_data or adc_data_en do not matter at the edge where adc_data_en rises, but they do matter in the following edge where the D for the flops calculated based on adc_data and adc_data_en are registered. All these are assuming adc_data_en and adc_data are synchronous to the clock. Edit: Adding to this, if you want adc_data_en to be evaluated in observed region, you can do something like this: property(@(posedge clk) disable iff (!adc_data_en) adc_data==true_data); However I would not recommend this. One reason is that, at the cycle where adc_data_en falls this checker will not fire, but it probably should. Second reason is that, at the edge where adc_data_en rises, this assertion may work in RTL sim with no timing delays or hold/setup time, but it will fail in a realistic gatevlevel simulation. As a rule of thumb synchronous signals should be used inside property where they are evaluated in preponed region.


  • hardware26toFPGA@lemmy.mlHow can I improve this hacky SV assertion?
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    You can use auxiliary code. It is usually more readable and less error prone that multi-trigger assertions. Something like: always @(negedge adc_sample) true_voltage <= input_channel; assert property(@(posedge clk) adc_data_en |-> adc_data == true_voltage); Note that behaviour is not completely equivalent, for example as long as adc_data_en is highassertion will keep matching, not only once when adc_data_en rises. If you want thevoriginal behaviour you can use $rose(adc_data_en). Auxiliary code also makes it easier for 20 delay case. For example you can clock the always block with posedge clock and use a 20-size shift-register which is conditionally enabled if adc_data_en in low. I am not sure of the intended behaviour so take it with a grain of salt.




  • Decoupling capacitor is there to filter out hogh frequency ripples from the lower supply. It is very hard for the consumer to know the high frequency current consumption of the chip, and its effects on the chip. Therefore decoupling is something where you should always follow the datasheet recommendation. As others said, ceramic capacitor has lower series resistance and inductance, which makes it the better choice for decoupling. Follow the instructions on layout as well, which usually says that decoupling capacitor should be as close as possible to the chip and grounded well. That being said, if you are prototyping on a breadboard, series inductance of a capacitor may not be your biggest concern, as breadboard connections will have that too. You can also still try to get your circuit working with the capacitor you have while waiting for ceramic one, chances are any capacitor will work good enough.




  • hardware26to196@lemmy.blahaj.zonebritish isles rule
    link
    fedilink
    arrow-up
    13
    ·
    6 months ago

    An emergency alert went off on my wife’s phone for a second time at 2.50, and 26 minutes later I still couldn’t fall asleep. I am also anxiously waiting for my alarm to ring any time. I don’t want to disable emergency alarms because they are important, but if they keep sending them in the middle of the night again and again at different hours they aren’t leaving me much choice.




  • hardware26toAsk ElectronicsSchematic review
    link
    fedilink
    English
    arrow-up
    3
    ·
    11 months ago

    DC motors have high inductance, meaning that the current going over it will resist to change. When you turn off a pair of nmos, current will likely start flowing over the the other pair, from source to drain. Depending on the spec of your nmos, you may consider using diodes in parallel to nmos to carry this current. Obviously these diodes should be reverse biased during normal operation.












  • As you said before power on capacitor is discharged. Right after power on capacitor is still discharged, so voltage on capacitor is zero, so reset pin has Vcc. With time capacitor gets charges and voltage across capacitor increases and reset voltage becomes closer and closer to ground, until it is ground. But it is important to consider what happens at power down too. At power down capacitor is charged. If power source becomes high impedance at power down, then reset pin will probably go down to zero in time but may take a bit time depending on what source exactly does. But if power source is connected to zero at power down reset pin will observe minus vcc and slowly go up to 0. If reset pin is sensitive it may be a good idea to protect it with a diode.