diff options
| author | whitequark <whitequark@whitequark.org> | 2019-01-29 02:24:00 +0000 | 
|---|---|---|
| committer | whitequark <whitequark@whitequark.org> | 2019-01-29 02:24:00 +0000 | 
| commit | da65e1e8d9552f64e1e03c08108ca0532719bbfe (patch) | |
| tree | bfdf72ced308dd77096bc29d4445f640dc50bc33 /kernel/celledges.h | |
| parent | 266511b29eb66486bd17210eb28454a2efee218a (diff) | |
| download | yosys-da65e1e8d9552f64e1e03c08108ca0532719bbfe.tar.gz yosys-da65e1e8d9552f64e1e03c08108ca0532719bbfe.tar.bz2 yosys-da65e1e8d9552f64e1e03c08108ca0532719bbfe.zip | |
write_verilog: correctly emit asynchronous transparent ports.
This commit fixes two related issues:
  * For asynchronous ports, clock is no longer added to domain list.
    (This would lead to absurd constructs like `always @(posedge 0)`.
  * The logic to distinguish synchronous and asynchronous ports is
    changed to correctly use or avoid clock in all cases.
Before this commit, the following RTLIL snippet (after memory_collect)
    cell $memrd $2
      parameter \MEMID "\\mem"
      parameter \ABITS 2
      parameter \WIDTH 4
      parameter \CLK_ENABLE 0
      parameter \CLK_POLARITY 1
      parameter \TRANSPARENT 1
      connect \CLK 1'0
      connect \EN 1'1
      connect \ADDR \mem_r_addr
      connect \DATA \mem_r_data
    end
would lead to invalid Verilog:
    reg [1:0] _0_;
    always @(posedge 1'h0) begin
      _0_ <= mem_r_addr;
    end
    assign mem_r_data = mem[_0_];
Note that there are two potential pitfalls remaining after this
change:
  * For asynchronous ports, the \EN input and \TRANSPARENT parameter
    are silently ignored. (Per discussion in #760 this is the correct
    behavior.)
  * For synchronous transparent ports, the \EN input is ignored. This
    matches the behavior of the $mem simulation cell. Again, see #760.
Diffstat (limited to 'kernel/celledges.h')
0 files changed, 0 insertions, 0 deletions
