-1

Pragma exist to tell the synthesis tool to ignore lines or blocks of code, using this:

-- synthesis translate_off
  ... code to ignore
-- synthesis translate on

But are there pragma that can be used to tell the simulator to ignore certain lines or blocks of code as they are intended for synthesis only and not be considered by the simulator tool?

EDIT:

OK here is an example just to make a point, a counter in synthesis counts upto 100,000. In simulation I need the simulation to run faster so in simulation the counter shall only run upto 100.

the busybee
  • 2,140
  • 8
  • 20
gyuunyuu
  • 1,933
  • 7
  • 31
  • Would you mind to [edit] your question and add, why you need this? An example would shed some light on it. Can't you divide your design into separate source files for the same purpose? – the busybee Nov 28 '22 at 09:43
  • OK here is an example just to make a point, a counter in synthesis counts upto 100,000. In simulation I need the simulation to run faster so in simulation the counter shall only run upto 100. – gyuunyuu Nov 30 '22 at 22:57
  • I don't think there is any pragma like that as it facilitates synth-sim mismatches beating the purpose of design. WRT your query, just use existing constructs, for eg: put a macro or so: `ifdef SYNTHESIS `define COUNT_MAX 100000 `else `define COUNT_MAX 100 – Mitu Raj Dec 01 '22 at 07:05
  • 1
    There's modifying a design with generate statements and configuration declarations describing binding for simulation. The granularity of the former is concurrent statements the latter entities and their architectures. There's also the use of generics for control flow. – user16145658 Dec 01 '22 at 20:28
  • I guess using generics is really the only thing can/should be done. – gyuunyuu Dec 04 '22 at 14:17

1 Answers1

2

It seems we are missing something like an else branch in such conditional translation. And standardization in general. Oh, well.

Consider using the freedom of formatting the source code:

-- other code
constant N : integer := 100000
-- synthesis translate_off
  - 99900
-- synthesis translate on
  ;
the busybee
  • 2,140
  • 8
  • 20