Skip to main content

Control all Build Systems

Project description

Wrapper around MeasureSuite. In fact there are two wrappers. First a simple C command line interface, which allows you to pass C code and the corresponding asm block. The program then compiles automatically the needed shared library for MeasureSuite and runs it. This simple command line interface is then again wrapped in a python library which allows for an even easier usage.

Build:

Run:

git clone --recursive https://github.com/FloydZ/MeasureSuiteCommandLine
cd MeasureSuiteCommandLine
pip install -r requirements.txt
./build.sh

and that should do it. If you have nix install you can alternatively run:

git clone --recursive https://github.com/FloydZ/MeasureSuiteCommandLine
cd MeasureSuiteCommandLine
nix-shell

NOTE: currently the nix approach is broken, as the relative import from git via requirements is not possible.

C Interface

After you build the library a binary main is available in build. Use it like so:

./main "#include <stdint.h>
void add_two_numbers(uint64_t *o, const uint64_t *i0, const uint64_t *i1) { 
        *o = *i0 + *i1;
}" "mov rax, [rsi] 
add rax, [rdx] 
mov [rdi], rax
ret
"

After everything run successful you should see the output:

{
"stats":
  {
   "countA": 1,
   "countB": 1,
   "chunksA": 0,
   "chunksB": 0,
   "batchSize": 1,
   "numBatches": 1,
   "runtime": 0,
   "runOrder": "ba",
   "checkResult": true
   },
"times": [[-1,4792,1196],[798,-1,771]]
}

Python Wrapper:

c_code = "#include <stdint.h>\nvoid add_two_numbers(uint64_t *o, const uint64_t *i0, const uint64_t *i1) {\n  *o = *i0 + *i1;\n}\n"
asm_code = "TODO"
w = MS([c_code, asm_code])
d = w.run()
print(d)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

measuresuitecommandline-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

measuresuitecommandline-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file measuresuitecommandline-0.1.0.tar.gz.

File metadata

  • Download URL: measuresuitecommandline-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for measuresuitecommandline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c969ee1ce1c257b633f069d09f5e109e18ed2e5683d442081b0dbaa9ae6f3cd6
MD5 1e56b3545cdd914d54f3704e4116dcd7
BLAKE2b-256 ac0ec1618126028ca80a495e5018108802c277c0cc702d5a1a3b8a24ec3ebeb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for measuresuitecommandline-0.1.0.tar.gz:

Publisher: publish.yml on FloydZ/MeasureSuiteCommandLine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file measuresuitecommandline-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for measuresuitecommandline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fc184073b820f55615f85336f574c1552739ffc3f7a545d5553b31e8e9d9123
MD5 717fad5406ed4c23c7236aed4774594a
BLAKE2b-256 be742bb20ed01f3ddc8853da4a9f8c8eac838d737469c35379ab2c856714c57a

See more details on using hashes here.

Provenance

The following attestation bundles were made for measuresuitecommandline-0.1.0-py3-none-any.whl:

Publisher: publish.yml on FloydZ/MeasureSuiteCommandLine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page