Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAM fix vendor tools tests #1268

Merged
merged 8 commits into from
Jan 23, 2020

Conversation

acomodi
Copy link
Contributor

@acomodi acomodi commented Jan 17, 2020

Signed-off-by: Alessandro Comodi acomodi@antmicro.com

Copy link
Contributor

@litghost litghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than disabling the dram test, let's just fix the fasm2bels bug?

@probot-autolabeler probot-autolabeler bot added the lang-verilog Issue uses (or requires) Verilog language. label Jan 20, 2020
@acomodi acomodi changed the title dram test: disable vivado target DRAM fix vendor tools tests Jan 20, 2020
@acomodi
Copy link
Contributor Author

acomodi commented Jan 20, 2020

Rather than disabling the dram test, let's just fix the fasm2bels bug?

Done. I think the issue was that there were orphan sinks due to the absence of routing to the INT tiles of the harness. By changing the designs, the problem should disappear.

@acomodi acomodi requested a review from litghost January 20, 2020 17:56
@litghost
Copy link
Contributor

FAILED: cd /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram && /usr/bin/cmake -E env PYTHONPATH=/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/env/conda/lib/python3.7/site-packages:/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/third_party/prjxray:/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/third_party/prjxray/third_party/fasm:/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7:/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/utils /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/env/conda/bin/python3 -mfasm2bels --db_root /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/third_party/prjxray-db/artix7 --rr_graph /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/archs/artix7/devices/rr_graph_xc7a50t-basys3_test.rr_graph.real.xml --route /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top.route --iostandard_defs /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top.eblif.iostandard.json --bitread /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/third_party/prjxray/tools/bitread --bit_file /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top.bit --fasm_file /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top.bit.fasm --pcf /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/common/basys3.pcf --eblif /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top.eblif --top top /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top_bit.v /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/tests/dram/dram_4_32x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top_bit.v.tcl --part xc7a35tcpg236-1 --connection_database /tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/xc7/archs/artix7/devices/xc7a50t-basys3-roi-virt/channels.db
Traceback (most recent call last):
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/env/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/build/env/conda/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/__main__.py", line 4, in <module>
    main()
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/fasm2bels.py", line 375, in main
    process_tile(top, tile, tile_features)
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/fasm2bels.py", line 98, in process_tile
    PROCESS_TILE[tile_type](top.conn, top, tile, tile_features)
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/clb_models.py", line 1177, in process_clb
    process_slice(top, slices[s])
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/clb_models.py", line 879, in process_slice
    site.add_internal_source(ram32, 'O', lut + "O6")
  File "/tmpfs/src/github/symbiflow-arch-defs-presubmit-xc7-vendor/xc7/fasm2bels/verilog_modeling.py", line 864, in add_internal_source
    bel.connections[bel_pin] = wire_name
AttributeError: 'list' object has no attribute 'connections'

@probot-autolabeler probot-autolabeler bot added the lang-python Issue uses (or requires) Python language. label Jan 21, 2020
@acomodi
Copy link
Contributor Author

acomodi commented Jan 21, 2020

@litghost I have tried to fix the issue with drams, but it seems that the problem is more complex than I first thought.
For instance, there are situations in which is not possible to determine from fasm, which dram needs to be used (dram_2_128x1s and dram_1_128x1d), as they are the same (at least when it comes to the CLBs features).

There are other different situations for which some sources are not being instantiated:

[100%] Generating dram_1_256x1s/artix7-xc7a50t-basys3-roi-virt-xc7a50t-basys3-test/top_bit.v
Traceback (most recent call last):
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/build/env/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/build/env/conda/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/__main__.py", line 4, in <module>
    main()
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/fasm2bels.py", line 375, in main
    process_tile(top, tile, tile_features)
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/fasm2bels.py", line 98, in process_tile
    PROCESS_TILE[tile_type](top.conn, top, tile, tile_features)
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/clb_models.py", line 1185, in process_clb
    process_slice(top, slices[s])
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/clb_models.py", line 1018, in process_slice
    site.connect_internal(bel, 'S[{}]'.format(idx), source)
  File "/home/alessandro/projects/symbiflow/tmp/symbiflow-arch-defs/xc7/fasm2bels/verilog_modeling.py", line 881, in connect_internal
    assert source in self.internal_sources, source
AssertionError: AO6

IMO this should be solved, but there are other higher priority things to be done, I have temporarily disabled the faulty vendor tool tests and enabled the ones that do pass.

@litghost
Copy link
Contributor

dram_2_128x1s and dram_1_128x1d

In both of these cases the output of fasm2bels should actually probably be a RAM64M + 2x F7MUX, which has no ambiguity.

dram_tests(1 32m 8 17)
dram_tests(1 64m 4 17)
# dram_tests(<dram_num_instances> <dram_mode> <syn_outpad_assert_usage> <syn_inpad_assert_usage> <enable_vivado_target>)
dram_tests(4 32x1s 4 11 N)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the 32x1s/32x1d failing? Please fix these two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding 32x1d it is currently enabled and completes correctly (dram_2_32x1d_vivado_diff_fasm).
As for 32x1s, vivado fails with the following error:

ERROR: [Vivado 12-2285] Cannot set LOC property of instance 'CLBLM_R_X3Y116_SLICE_X2Y116_RAM32X1S_C_0',  for bel C5LUT Two RAM symbols can not share a LUT site if two RAM symbols are not also sharing the D LUT site. There are fewer than two RAM symbols in the D LUT site,  for bel D5LUT Both D6LUT and D5LUT are occupied by a RAM. This prevents LUT xxx to go to site yyy
Resolution: When using BEL constraints, ensure the BEL constraints are defined before the LOC constraints to avoid conflicts at a given site.

I have tried to adopt the Resolution suggested, but the same failure is produced.

@probot-autolabeler probot-autolabeler bot added lang-xml Issues uses (or requires) XML language. type-vpr labels Jan 22, 2020
@acomodi
Copy link
Contributor Author

acomodi commented Jan 22, 2020

@litghost I have seen that Vivado implements the 32x1s DRAM mode in a different way than done in Symbiflow. In fact here is the fasm I get:

Vivado:

CLBLM_R_X3Y15.SLICEL_X1.NOCLKINV
CLBLM_R_X3Y15.SLICEL_X1.PRECYINIT.C0
CLBLM_R_X3Y15.SLICEM_X0.ALUT.DI1MUX.BDI1_BMC31
CLBLM_R_X3Y15.SLICEM_X0.ALUT.INIT[33]
CLBLM_R_X3Y15.SLICEM_X0.ALUT.RAM
CLBLM_R_X3Y15.SLICEM_X0.ALUT.SMALL
CLBLM_R_X3Y15.SLICEM_X0.BLUT.DI1MUX.DI_CMC31
CLBLM_R_X3Y15.SLICEM_X0.BLUT.INIT[33]
CLBLM_R_X3Y15.SLICEM_X0.BLUT.RAM
CLBLM_R_X3Y15.SLICEM_X0.BLUT.SMALL
CLBLM_R_X3Y15.SLICEM_X0.CLUT.DI1MUX.DI_DMC31
CLBLM_R_X3Y15.SLICEM_X0.CLUT.INIT[33]
CLBLM_R_X3Y15.SLICEM_X0.CLUT.RAM
CLBLM_R_X3Y15.SLICEM_X0.CLUT.SMALL
CLBLM_R_X3Y15.SLICEM_X0.DLUT.INIT[33]
CLBLM_R_X3Y15.SLICEM_X0.DLUT.RAM
CLBLM_R_X3Y15.SLICEM_X0.DLUT.SMALL
CLBLM_R_X3Y15.SLICEM_X0.NOCLKINV
CLBLM_R_X3Y15.SLICEM_X0.PRECYINIT.C0
CLBLM_R_X3Y15.SLICEM_X0.WEMUX.CE

SymbiFlow:

CLBLM_R_X3Y116.SLICEL_X1.NOCLKINV
CLBLM_R_X3Y116.SLICEL_X1.PRECYINIT.C0
CLBLM_R_X3Y116.SLICEM_X0.ALUT.DI1MUX.BDI1_BMC31
CLBLM_R_X3Y116.SLICEM_X0.BLUT.DI1MUX.DI_CMC31
CLBLM_R_X3Y116.SLICEM_X0.CLUT.DI1MUX.CI
CLBLM_R_X3Y116.SLICEM_X0.CLUT.INIT[33:0] = 34'b1000000000000000000000000000000010
CLBLM_R_X3Y116.SLICEM_X0.CLUT.RAM
CLBLM_R_X3Y116.SLICEM_X0.CLUT.SMALL
CLBLM_R_X3Y116.SLICEM_X0.COUTMUX.O5
CLBLM_R_X3Y116.SLICEM_X0.DLUT.INIT[33:0] = 34'b1000000000000000000000000000000010
CLBLM_R_X3Y116.SLICEM_X0.DLUT.RAM
CLBLM_R_X3Y116.SLICEM_X0.DLUT.SMALL
CLBLM_R_X3Y116.SLICEM_X0.DOUTMUX.O5
CLBLM_R_X3Y116.SLICEM_X0.NOCLKINV
CLBLM_R_X3Y116.SLICEM_X0.PRECYINIT.C0
CLBLM_R_X3Y116.SLICEM_X0.WEMUX.CE

ALUT and BLUT are not used in SymbiFlow, and the stuff is packed as it were a 64x1s. This actually happens because the {n}_dram.pb_type does not have a way to pack a single 32x1s. In fact, if there are two different dram_32x1s to be packed, they will be packed in the same LUT, using both the D05 and D06 outputs, instead of getting in two different LUTs, therefore using D06 outputs only.

I have added an additional pb_type, with an additional model, so to have the 32_SINGLE_PORT packing only a single 32x1s dram at a time, using all the 4 different LUTs for the dram_4_32x1s test

Does this make sense?

Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
@litghost
Copy link
Contributor

litghost commented Jan 22, 2020

So I think the problem is the order that Vivado and Symbiflow pack 32X1S's. I'm guessing (without strong evidence) that Vivado packs:

  1. DLUT.O6
  2. CLUT.O6
  3. BLUT.O6
  4. ALUT.O6
  5. DLUT.O5
  6. CLUT.O5
  7. BLUT.O5
  8. ALUT.O5

And symbiflow was packing:

  1. DLUT.O6
  2. DLUT.O5
  3. CLUT.O6
  4. CLUT.O5
  5. BLUT.O6
  6. BLUT.O5
  7. ALUT.O6
  8. ALUT.O5

We probably need a minitest to verify.

@litghost
Copy link
Contributor

I have added an additional pb_type, with an additional model, so to have the 32_SINGLE_PORT packing only a single 32x1s dram at a time, using all the 4 different LUTs for the dram_4_32x1s test

The new structure allows only 4 32x1s per SLICEM, which defeats the purpose of supporting 32-bit LUT-RAMs. If we cannot accomidate 8 32x1s, we should not advertise support for them. I believe RAM32M is working though, which can be used to implement all variants.

@acomodi
Copy link
Contributor Author

acomodi commented Jan 23, 2020

I have added an additional pb_type, with an additional model, so to have the 32_SINGLE_PORT packing only a single 32x1s dram at a time, using all the 4 different LUTs for the dram_4_32x1s test

The new structure allows only 4 32x1s per SLICEM, which defeats the purpose of supporting 32-bit LUT-RAMs. If we cannot accomidate 8 32x1s, we should not advertise support for them. I believe RAM32M is working though, which can be used to implement all variants.

So, As far as I have seen, the dram_8_32x1s, if run on Vivado, packs the LUTS in two different CLBs using only O6 outputs (this happens without any kind of user constraints). To verify that I have simply built the verilog design with Vivado and analyze the implemented results.

Screenshot from 2020-01-23 09-35-53

<xi:include href="spram32.pb_type.xml" xpointer="xpointer(pb_type/metadata/child::node())" />
<meta name="fasm_params">
INIT[63:32] = INIT_00
INIT[31:0] = INIT_ZERO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an XML comment explaining that this is known to be wrong? Open a new issue about fixing the RAM32's in the future.

@litghost litghost merged commit 83d00eb into f4pga:master Jan 23, 2020
@acomodi acomodi deleted the fix-dram-tests-vendor-tools branch January 27, 2020 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-python Issue uses (or requires) Python language. lang-verilog Issue uses (or requires) Verilog language. lang-xml Issues uses (or requires) XML language. type-vpr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants