gowin: cleanup a few header dependencies to make LSP a bit happier

This still leaves some warnings about indirect header includes which is
annoying but those can be cleaned up later if desired. The changes to
how constants are handled makes the LSP able to actually handle the
header files that use constants at the cost of making it see the body of the
himbaechel_constids.h file as commented out.
This commit is contained in:
Lunaphied 2026-04-04 11:52:40 +02:00
parent 41032f9d77
commit b6b429ad43
8 changed files with 15 additions and 12 deletions

View File

@ -19,6 +19,7 @@
#ifndef HIMBAECHEL_CONSTIDS_H
#define HIMBAECHEL_CONSTIDS_H
#ifdef HIMBAECHEL_CONSTIDS
/*
This enables use of 'constids' similar to a 'true' nextpnr arch in a HIMBAECHEL uarch.
@ -32,9 +33,7 @@ init
#include "nextpnr_namespaces.h"
#ifdef HIMBAECHEL_MAIN
#include "idstring.h"
#endif
NEXTPNR_NAMESPACE_BEGIN
@ -72,3 +71,4 @@ void init_uarch_constids(Arch *arch)
NEXTPNR_NAMESPACE_END
#endif
#endif

View File

@ -3,12 +3,9 @@
#include <utility>
#include "log.h"
#include "nextpnr.h"
#include "util.h"
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"
#include "himbaechel_constids.h"
#include "himbaechel_helpers.h"
#include "cst.h"
#include "gowin.h"

View File

@ -4,7 +4,6 @@
#include "himbaechel_api.h"
#include "himbaechel_helpers.h"
#include "log.h"
#include "nextpnr.h"
#define GEN_INIT_CONSTIDS
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"

View File

@ -1,6 +1,9 @@
#ifndef GOWIN_H
#define GOWIN_H
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"
#include "himbaechel_constids.h"
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN

View File

@ -1,6 +1,13 @@
#ifndef GOWIN_UTILS_H
#define GOWIN_UTILS_H
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"
#include "himbaechel_constids.h"
#include "himbaechel_helpers.h"
#include "gowin.h"
#include "design_utils.h"
#include "idstringlist.h"
#include "nextpnr_namespaces.h"

View File

@ -1,7 +1,9 @@
#ifndef GOWIN_PACK_H
#define GOWIN_PACK_H
#include "nextpnr.h"
#include "himbaechel_helpers.h"
#include "gowin_utils.h"
NEXTPNR_NAMESPACE_BEGIN

View File

@ -1,6 +1,5 @@
#include "design_utils.h"
#include "log.h"
#include "nextpnr.h"
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"
#include "himbaechel_constids.h"
@ -10,7 +9,6 @@
#include "gowin_utils.h"
#include "pack.h"
#include <cinttypes>
NEXTPNR_NAMESPACE_BEGIN

View File

@ -1,6 +1,5 @@
#include "design_utils.h"
#include "log.h"
#include "nextpnr.h"
#define HIMBAECHEL_CONSTIDS "uarch/gowin/constids.inc"
#include "himbaechel_constids.h"
@ -10,8 +9,6 @@
#include "gowin_utils.h"
#include "pack.h"
#include <cinttypes>
NEXTPNR_NAMESPACE_BEGIN
// ===================================