Dataset Open Access

Hardware Synthesis of Weakly Consistent C Concurrency

Nadesh Ramanathan; Shane Fleming; John Wickerson; George Constantinides


MARC21 XML Export

<?xml version='1.0' encoding='UTF-8'?>
<record xmlns="http://www.loc.gov/MARC21/slim">
  <leader>00000nmm##2200000uu#4500</leader>
  <datafield tag="540" ind1=" " ind2=" ">
    <subfield code="u">https://creativecommons.org/licenses/by/4.0/</subfield>
    <subfield code="a">Creative Commons Attribution 4.0</subfield>
  </datafield>
  <datafield tag="260" ind1=" " ind2=" ">
    <subfield code="c">2016-12-02</subfield>
  </datafield>
  <controlfield tag="005">20170908084833.0</controlfield>
  <controlfield tag="001">200339</controlfield>
  <datafield tag="909" ind1="C" ind2="O">
    <subfield code="p">openaire_data</subfield>
    <subfield code="o">oai:zenodo.org:200339</subfield>
  </datafield>
  <datafield tag="520" ind1=" " ind2=" ">
    <subfield code="a">&lt;p&gt;Hardware Synthesis of Weakly Consistency C Concurrency&lt;/p&gt;

&lt;p&gt;This webpage contains additional material for the paper Hardware Synthesis of Weakly Consistent C Concurrency (FPGA17paper.pdf). &lt;/p&gt;

&lt;p&gt;Contents&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Verifying that our scheduling constraints implement the C11 standard&lt;/li&gt;
	&lt;li&gt;Verifying the lock-free circular buffer&lt;/li&gt;
	&lt;li&gt;Motivating examples&lt;/li&gt;
	&lt;li&gt;Experimental Data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;1. Verifying that our scheduling constraints implement the C11 standard&lt;/p&gt;

&lt;p&gt;As explained in Section 4.4, we have used the Alloy tool to verify that our scheduling constraints are sufficient to implement the memory consistency model defined by the C11 standard. In alloy.zip, we provide the Alloy model files that we used. The first four are taken from Wickerson et al.'s work on comparing memory consistency models; the fifth is new.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;relations.als contains helper functions.&lt;/li&gt;
	&lt;li&gt;exec.als encodes general program executions.&lt;/li&gt;
	&lt;li&gt;exec_C.als encodes C11 program executions.&lt;/li&gt;
	&lt;li&gt;c11.als encodes the constraints imposed by the C11 memory consistency model.&lt;/li&gt;
	&lt;li&gt;question.als encodes our scheduling constraints, and several queries for checking that these scheduling constraints are strong enough to enforce the constraints required by the C11 memory consistency model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To reproduce our result, save the five files above into the same directory, download Alloy, open question.als in Alloy, and run the queries contained within.&lt;/p&gt;

&lt;p&gt;2. Verifying the lock-free circular buffer&lt;/p&gt;

&lt;p&gt;As explained in Section 5.1, we have used the CppMem tool to verify that our case-study application, a lock-free circular buffer, is free from data races. In order to make the verification feasible, we removed the while-loop, replaced the array variable with a scalar, removed some unimportant local variables, and simplified the increment function. Below, we give the actual code that we verified.&lt;br&gt;
&lt;br&gt;
int main() {&lt;br&gt;
  atomic_int tail = 0;&lt;br&gt;
  atomic_int head = 0;&lt;br&gt;
  int arr = 0;&lt;br&gt;
  {{{ {&lt;br&gt;
    int chead = head.load(memory_order_acquire);&lt;br&gt;
    int ctail = tail.load(memory_order_relaxed);&lt;br&gt;
    if (ctail+1 != chead) {&lt;br&gt;
      arr = 42;&lt;br&gt;
      tail.store(ctail+1, memory_order_release);&lt;br&gt;
    }&lt;br&gt;
  } ||| {&lt;br&gt;
    int ctail = tail.load(memory_order_acquire);&lt;br&gt;
    int chead = head.load(memory_order_relaxed);&lt;br&gt;
    if (ctail != chead) {&lt;br&gt;
      arr;&lt;br&gt;
      head.store(chead+1, memory_order_release);&lt;br&gt;
    }&lt;br&gt;
  } }}}&lt;br&gt;
  return 0;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;To reproduce our result, paste the code above into CppMem's web interface and click Run. The tool should report (after a couple of minutes) that the code has 92 candidate executions, of which two are consistent, neither of which exhibit data races.&lt;/p&gt;

&lt;p&gt;3. Motivating Examples&lt;/p&gt;

&lt;p&gt;We provide the actual code that displays coherence and message-passing violation in motivating-examples.zip, as described in Section 2 of our paper. These examples have been tested and verified on LegUp's VM. For convenience, we have included the output logs of each experiment for viewing. We include a "transcript" of the execution and a schedule trace, which can be visualised using LegUp's scheduleviewer.&lt;/p&gt;

&lt;p&gt;4. Experimental Data&lt;/p&gt;

&lt;p&gt;We also provide the raw experiment data from Section 5 of our paper. We conduct two experiments, for which we provided raw data on all seven design points.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;chaining.csv contains the raw data for the chaining experiment.&lt;/li&gt;
	&lt;li&gt;bursting.csv contains the raw data for the bursting experiment.&lt;/li&gt;
	&lt;li&gt;The version number are from 1 to 7 for Unsound, SC, OMP criticals, SC atomics, Weak atomics, Mutexes and OMP atomics respectively.&lt;/li&gt;
&lt;/ul&gt;</subfield>
  </datafield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">Shane Fleming</subfield>
  </datafield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">John Wickerson</subfield>
  </datafield>
  <datafield tag="700" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">George Constantinides</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">6193</subfield>
    <subfield code="z">md5:04ea201158687761bcb026eca9de9175</subfield>
    <subfield code="u">https://zenodo.org/record/200339/files/alloy.zip</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">1574</subfield>
    <subfield code="z">md5:97282154804e8324ac886324a8c52740</subfield>
    <subfield code="u">https://zenodo.org/record/200339/files/bursting.csv</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">5783</subfield>
    <subfield code="z">md5:10cb0794eec17ff46ce4002a101cd24d</subfield>
    <subfield code="u">https://zenodo.org/record/200339/files/chaining.csv</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">635271</subfield>
    <subfield code="z">md5:1aad77b850b2a7b9faf9fd439783a9e8</subfield>
    <subfield code="u">https://zenodo.org/record/200339/files/FPGA17paper.pdf</subfield>
  </datafield>
  <datafield tag="856" ind1="4" ind2=" ">
    <subfield code="s">7393</subfield>
    <subfield code="z">md5:5564f2af398872b8192135abad2bd3a9</subfield>
    <subfield code="u">https://zenodo.org/record/200339/files/motivating-examples.zip</subfield>
  </datafield>
  <datafield tag="542" ind1=" " ind2=" ">
    <subfield code="l">open</subfield>
  </datafield>
  <datafield tag="980" ind1=" " ind2=" ">
    <subfield code="a">dataset</subfield>
  </datafield>
  <datafield tag="100" ind1=" " ind2=" ">
    <subfield code="u">Imperial College London</subfield>
    <subfield code="a">Nadesh Ramanathan</subfield>
  </datafield>
  <datafield tag="653" ind1=" " ind2=" ">
    <subfield code="a">atomic operations, C/C++, FPGAs, high-level synthesis, lock-free algorithms, memory consistency models, scheduling</subfield>
  </datafield>
  <datafield tag="024" ind1=" " ind2=" ">
    <subfield code="a">10.5281/zenodo.200339</subfield>
    <subfield code="2">doi</subfield>
  </datafield>
  <datafield tag="245" ind1=" " ind2=" ">
    <subfield code="a">Hardware Synthesis of Weakly Consistent C Concurrency</subfield>
  </datafield>
  <datafield tag="650" ind1="1" ind2="7">
    <subfield code="a">cc-by</subfield>
    <subfield code="2">opendefinition.org</subfield>
  </datafield>
</record>

Share

Cite as