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

common.mk: Yosys compatible output can be generated by firtool without invoking SFC before MFC #1661

Closed
wants to merge 1 commit into from

Conversation

oharboe
Copy link
Contributor

@oharboe oharboe commented Nov 13, 2023

changelog:fixed

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

@abejgonzalez
Copy link
Contributor

@nayiri-k is looking at this and testing it.

common.mk Outdated
MFC_BASE_LOWERING_OPTIONS += ,
endif
MFC_BASE_LOWERING_OPTIONS += disallowPackedArrays
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this flag was already added before:

ifeq (,$(ENABLE_YOSYS_FLOW))
.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally,

ifeq (,$(ENABLE_YOSYS_FLOW))
needs to change so that the flag isn't added by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

diff --git a/common.mk b/common.mk
index f6bc19c1..50a6b531 100644
--- a/common.mk
+++ b/common.mk
@@ -28,7 +28,7 @@ EXTRA_SIM_CXXFLAGS   ?=
 EXTRA_SIM_LDFLAGS    ?=
 EXTRA_SIM_SOURCES    ?=
 EXTRA_SIM_REQS       ?=
-ENABLE_CUSTOM_FIRRTL_PASS += $(ENABLE_YOSYS_FLOW)
+# ENABLE_CUSTOM_FIRRTL_PASS += $(ENABLE_YOSYS_FLOW)
 
 ifneq ($(ASPECTS), )
        comma = ,
@@ -191,6 +191,12 @@ SFC_MFC_TARGETS = \
 
 SFC_REPL_SEQ_MEM = --infer-rw --repl-seq-mem -c:$(MODEL):-o:$(SFC_SMEMS_CONF)
 MFC_BASE_LOWERING_OPTIONS ?= emittedLineLength=2048,noAlwaysComb,disallowLocalVariables,verifLabels,locationInfoStyle=wrapInAtSquareBracket
+ifneq ($(ENABLE_YOSYS_FLOW),)
+       ifneq ($(MFC_BASE_LOWERING_OPTIONS),)
+               MFC_BASE_LOWERING_OPTIONS := $(MFC_BASE_LOWERING_OPTIONS),
+       endif
+       MFC_BASE_LOWERING_OPTIONS := $(MFC_BASE_LOWERING_OPTIONS)disallowPackedArrays
+endif
 
 # DOC include start: FirrtlCompiler
 # There are two possible cases for this step. In the first case, SFC
@@ -215,11 +221,12 @@ endif
 
 $(MFC_LOWERING_OPTIONS):
        mkdir -p $(dir $@)
-ifeq (,$(ENABLE_YOSYS_FLOW))
        echo "$(MFC_BASE_LOWERING_OPTIONS)" > $@
-else
-       echo "$(MFC_BASE_LOWERING_OPTIONS),disallowPackedArrays" > $@
-endif
+# ifeq (,$(ENABLE_YOSYS_FLOW))
+#      echo "$(MFC_BASE_LOWERING_OPTIONS)" > $@
+# else
+#      echo "$(MFC_BASE_LOWERING_OPTIONS),disallowPackedArrays" > $@
+# endif
 
 $(FINAL_ANNO_FILE): $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) $(SFC_LEVEL)
        if [ $(shell cat $(SFC_LEVEL)) = low ]; then jq -s '[.[][]]' $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) > $@; fi

Copy link
Contributor

Choose a reason for hiding this comment

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

In the vlsi directory, I ran make buildfile tutorial=sky130-openroad which compiles a TinyRocketConfig, which gave the error: unsupported packed array expression. It seems that the disallowPackedArrays doesn't work in all cases.

Copy link
Contributor Author

@oharboe oharboe Nov 16, 2023

Choose a reason for hiding this comment

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

@nayiri-k Try with the latest firtool(not released yet, will be in firtool >1.59.0), should be fixed in llvm/circt#6402

Copy link
Contributor

Choose a reason for hiding this comment

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

Once FIRTOOL > 1.59.0 is released I'll update the feedstock and we can run CI on this to see what happens (probably after the holiday break I assume).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

…t invoking SFC before MFC

Signed-off-by: Øyvind Harboe <[email protected]>
@oharboe oharboe force-pushed the yosys-simplification branch from 256258c to 9da1236 Compare November 15, 2023 22:07
@oharboe oharboe requested a review from abejgonzalez November 15, 2023 22:07
@abejgonzalez
Copy link
Contributor

@Mergifyio rebase main

Copy link

mergify bot commented Dec 8, 2023

rebase main

❌ Pull request can't be updated with latest base branch changes

Mergify needs the author permission to update the base branch of the pull request.
@Pinata-Consulting needs to authorize modification on its head branch.

@abejgonzalez
Copy link
Contributor

@Mergifyio copy main

Copy link

mergify bot commented Dec 8, 2023

copy main

✅ Pull request copies have been created

@abejgonzalez
Copy link
Contributor

#1695 updates this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants