Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorYing committed Dec 2, 2024
2 parents 0113d28 + 61a9d5e commit 3438923
Show file tree
Hide file tree
Showing 18 changed files with 218 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
jobs:
- job: osx
pool:
vmImage: macOS-12
vmImage: macOS-13
strategy:
matrix:
osx_64_:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ c_compiler:
c_compiler_version:
- '13'
cdt_name:
- cos7
- conda
channel_sources:
- conda-forge
channel_targets:
Expand All @@ -15,7 +15,7 @@ cxx_compiler:
cxx_compiler_version:
- '13'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
- quay.io/condaforge/linux-anvil-x86_64:alma9
hdf5:
- 1.14.3
linux_clang_version:
Expand Down
8 changes: 4 additions & 4 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.1'
- '14.5'
MACOSX_SDK_VERSION:
- '11.1'
- '14.5'
boost:
- '1.78'
c_compiler:
- clang
c_compiler_version:
- '17'
- '18'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '17'
- '18'
hdf5:
- 1.14.3
macos_machine:
Expand Down
8 changes: 4 additions & 4 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.1'
- '14.5'
MACOSX_SDK_VERSION:
- '11.1'
- '14.5'
boost:
- '1.78'
c_compiler:
- clang
c_compiler_version:
- '17'
- '18'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '17'
- '18'
hdf5:
- 1.14.3
macos_machine:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
environment:
- CONFIG: "linux_64_"
- UPLOAD_PACKAGES: "False"
DOCKER_IMAGE: "quay.io/condaforge/linux-anvil-cos7-x86_64"
DOCKER_IMAGE: "quay.io/condaforge/linux-anvil-x86_64:alma9"
steps:
- checkout
- run:
Expand Down
16 changes: 9 additions & 7 deletions .scripts/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ pkgs_dirs:
solver: libmamba
CONDARC
mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S)
echo > /opt/conda/conda-meta/history
micromamba install --root-prefix ~/.conda --prefix /opt/conda \
--yes --override-channels --channel conda-forge --strict-channel-priority \
pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1

mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1"

# set up the condarc
setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

source run_conda_forge_build_setup



# make the build number clobber
make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"

Expand Down Expand Up @@ -71,8 +73,8 @@ else
--extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}"
( startgroup "Inspecting artifacts" ) 2> /dev/null

# inspect_artifacts was only added in conda-forge-ci-setup 4.6.0
command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0"
# inspect_artifacts was only added in conda-forge-ci-setup 4.9.4
command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4"

( endgroup "Inspecting artifacts" ) 2> /dev/null

Expand Down
45 changes: 28 additions & 17 deletions .scripts/run_osx_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,39 @@ source .scripts/logging_utils.sh
set -xe

MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3}
MINIFORGE_HOME=${MINIFORGE_HOME%/} # remove trailing slash

( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null

MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download"
MINIFORGE_FILE="Miniforge3-MacOSX-$(uname -m).sh"
curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}"
rm -rf ${MINIFORGE_HOME}
bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME}

( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null
( startgroup "Provisioning base env with micromamba" ) 2> /dev/null
MICROMAMBA_VERSION="1.5.10-0"
if [[ "$(uname -m)" == "arm64" ]]; then
osx_arch="osx-arm64"
else
osx_arch="osx-64"
fi
MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}"
MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)"
echo "Downloading micromamba ${MICROMAMBA_VERSION}"
micromamba_exe="$(mktemp -d)/micromamba"
curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}"
chmod +x "${micromamba_exe}"
echo "Creating environment"
"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \
--channel conda-forge \
pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}"
mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}"
echo "Cleaning up micromamba"
rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true
( endgroup "Provisioning base env with micromamba" ) 2> /dev/null

( startgroup "Configuring conda" ) 2> /dev/null

source ${MINIFORGE_HOME}/etc/profile.d/conda.sh
echo "Activating environment"
source "${MINIFORGE_HOME}/etc/profile.d/conda.sh"
conda activate base
export CONDA_SOLVER="libmamba"
export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1

mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \
pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1"




Expand Down Expand Up @@ -84,8 +95,8 @@ else

( startgroup "Inspecting artifacts" ) 2> /dev/null

# inspect_artifacts was only added in conda-forge-ci-setup 4.6.0
command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0"
# inspect_artifacts was only added in conda-forge-ci-setup 4.9.4
command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir ./conda.recipe -m ./.ci_support/${CONFIG}.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4"

( endgroup "Inspecting artifacts" ) 2> /dev/null

Expand Down
29 changes: 27 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,30 @@
# update the conda-forge.yml and/or the recipe/meta.yaml.
# -*- mode: yaml -*-

jobs:
- template: ./.azure-pipelines/azure-pipelines-osx.yml
stages:
- stage: Check
jobs:
- job: Skip
pool:
vmImage: 'ubuntu-22.04'
variables:
DECODE_PERCENTS: 'false'
RET: 'true'
steps:
- checkout: self
fetchDepth: '2'
- bash: |
git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "`
echo "##vso[task.setvariable variable=log]$git_log"
displayName: Obtain commit message
- bash: echo "##vso[task.setvariable variable=RET]false"
condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')))
displayName: Skip build?
- bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET"
name: result
displayName: Export result
- stage: Build
condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true'))
dependsOn: Check
jobs:
- template: ./.azure-pipelines/azure-pipelines-osx.yml
2 changes: 1 addition & 1 deletion conda.recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
macos_machine: # [osx]
- arm64-apple-darwin20.0.0 # [osx and arm64]
MACOSX_DEPLOYMENT_TARGET: # [osx]
- 11.1 # [osx]
- 14.5 # [osx]

# linux_clang_version is not a part of zip_keys
# from conda-forge, if you want to, you can
Expand Down
3 changes: 2 additions & 1 deletion sparta/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ build*
[Ff]ast[Dd]ebug*
cmake-build-*
*~
compile_commands.json
compile_commands.json
.vscode
8 changes: 7 additions & 1 deletion sparta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ if (ENABLE_SANITIZERS)
endif ()

set(CMAKE_CXX_FLAGS_PROFILE "-O3 -pg -g")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
if(DEFINED SPARTA_CXX_FLAGS_DEBUG AND SPARTA_CXX_FLAGS_DEBUG)
set(CMAKE_CXX_FLAGS_DEBUG "${SPARTA_CXX_FLAGS_DEBUG}")
message(STATUS "Using Sparta custom debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
message(STATUS "Using Sparta default debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
endif()

#
# If we're using CONDA, we might be using the one suggested for
Expand Down
54 changes: 53 additions & 1 deletion sparta/sparta/functional/Register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,48 @@ class Register : public RegisterBase
return ss.str();
}

/*!
* \brief Index of read/write access within register
*/
typedef RegisterBase::index_type index_type;

/*!
* \brief Read value directly from the Register's backing store
* \note This is intentionally hiding the dmiRead() from the base
* class so we don't have to go through the dmiRead_() virtual method.
*/
template <typename T>
inline T dmiRead(index_type idx = 0) const
{
T res;
dmiReadImpl_(&res, sizeof(res), sizeof(res) * idx);
return res;
}

/*!
* \brief Write a value directly to this Register's backing store
* \note No masking, boundary checkor or notification is performed
* \note This is intentionally hiding the dmiWrite() from the base
* class so we don't have to go through the dmiWrite_() virtual method.
*/
template <typename T>
inline void dmiWrite(T val, index_type idx = 0)
{
dmiWriteImpl_(&val, sizeof(val), sizeof(val) * idx);
}

/*!
* \brief Write a value into this register without it being affected by the write-mask
* \warning This ignores read-only fields
* \note This is intentionally hiding the writeUnmasked() from the base
* class so we don't have to go through the dmiWriteImpl_() virtual method.
*/
template <typename T>
inline void writeUnmasked(T val, index_type idx = 0)
{
dmiWriteImpl_(&val, sizeof(T), idx);
}

private:
/*!
* \brief Discover and store the raw location of this Register's data
Expand Down Expand Up @@ -1536,7 +1578,7 @@ class Register : public RegisterBase

void dmiRead_(void *buf, size_t size, size_t offset = 0) const override final
{
memcpy(buf, raw_data_ptr_ + offset, size);
dmiReadImpl_(buf, size, offset);
}

void write_(const void *buf, size_t size, size_t offset=0) override final
Expand All @@ -1559,6 +1601,16 @@ class Register : public RegisterBase
}

void dmiWrite_(const void *buf, size_t size, size_t offset = 0) override final
{
dmiWriteImpl_(buf, size, offset);
}

inline void dmiReadImpl_(void *buf, size_t size, size_t offset = 0) const
{
memcpy(buf, raw_data_ptr_ + offset, size);
}

inline void dmiWriteImpl_(const void *buf, size_t size, size_t offset = 0)
{
memcpy(raw_data_ptr_ + offset, buf, size);
dview_.getLine()->flagDirty();
Expand Down
19 changes: 11 additions & 8 deletions sparta/sparta/functional/RegisterSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,9 @@ class RegisterSet : public TreeNode
const RegisterBase::Definition *defs,
const RegisterProxyBase::Definition *proxy_defs,
CurrentBankFunction cbfxn,
RegisterTypeTag<RegisterT> tag)
: TreeNode("regs",
RegisterTypeTag<RegisterT> tag,
const std::string& name = "regs")
: TreeNode(name,
TreeNode::GROUP_NAME_BUILTIN,
TreeNode::GROUP_IDX_NONE,
"Register set")
Expand Down Expand Up @@ -530,8 +531,9 @@ class RegisterSet : public TreeNode
template <typename RegisterT>
RegisterSet(TreeNode *parent,
const RegisterBase::Definition *defs,
RegisterTypeTag<RegisterT> tag)
: RegisterSet(parent, defs, nullptr, nullptr, tag)
RegisterTypeTag<RegisterT> tag,
const std::string& name = "regs")
: RegisterSet(parent, defs, nullptr, nullptr, tag, name)
{
// Handled in delegated consturctor
}
Expand All @@ -541,18 +543,19 @@ class RegisterSet : public TreeNode
create(TreeNode *parent,
const RegisterBase::Definition *defs,
const RegisterProxyBase::Definition *proxy_defs,
CurrentBankFunction cbfxn)
CurrentBankFunction cbfxn,
const std::string& name = "regs")
{
return std::unique_ptr<RegisterSet>(new RegisterSet(
parent, defs, proxy_defs, cbfxn, RegisterTypeTag<RegisterT>()));
parent, defs, proxy_defs, cbfxn, RegisterTypeTag<RegisterT>(), name));
}

template <typename RegisterT = Register>
static std::unique_ptr<RegisterSet>
create(TreeNode *parent, const RegisterBase::Definition *defs)
create(TreeNode *parent, const RegisterBase::Definition *defs, const std::string& name = "regs")
{
return std::unique_ptr<RegisterSet>(new RegisterSet(
parent, defs, RegisterTypeTag<RegisterT>()));
parent, defs, RegisterTypeTag<RegisterT>(), name));
}

/*!
Expand Down
Loading

0 comments on commit 3438923

Please sign in to comment.