hmml_to_html.c: Reference indicators [#15]
Also support multiple annotations citing the same reference
This commit is contained in:
parent
012693bd39
commit
388c60e942
|
@ -66,7 +66,8 @@ main(int ArgC, char **Args)
|
||||||
|
|
||||||
// NOTE(matt): Init MemoryArena
|
// NOTE(matt): Init MemoryArena
|
||||||
char *MemoryArena;
|
char *MemoryArena;
|
||||||
int ArenaSize = 1024 * 64;
|
// TODO(matt): Actually calculate how much memory I'll need
|
||||||
|
int ArenaSize = 1024 * 512;
|
||||||
if(!(MemoryArena = calloc(ArenaSize, 1)))
|
if(!(MemoryArena = calloc(ArenaSize, 1)))
|
||||||
{
|
{
|
||||||
perror(Args[0]);
|
perror(Args[0]);
|
||||||
|
@ -76,28 +77,12 @@ main(int ArgC, char **Args)
|
||||||
|
|
||||||
// NOTE(matt): Setup buffers and ptrs
|
// NOTE(matt): Setup buffers and ptrs
|
||||||
char *InPtr;
|
char *InPtr;
|
||||||
buffer Template;
|
|
||||||
buffer Working;
|
buffer Working;
|
||||||
|
buffer Text;
|
||||||
buffer Out;
|
buffer Out;
|
||||||
|
|
||||||
FILE *TemplateFile;
|
|
||||||
if(!(TemplateFile = fopen("style.css", "r")))
|
|
||||||
{
|
|
||||||
perror(Args[0]);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fseek(TemplateFile, 0, SEEK_END);
|
|
||||||
Template.Size = ftell(TemplateFile);
|
|
||||||
fseek(TemplateFile, 0, SEEK_SET);
|
|
||||||
|
|
||||||
Template.Location = MemoryArena + ClaimedMemory;
|
|
||||||
ClaimedMemory += Template.Size;
|
|
||||||
fread(Template.Location, Template.Size, 1, TemplateFile);
|
|
||||||
fclose(TemplateFile);
|
|
||||||
|
|
||||||
Out.Location = MemoryArena + ClaimedMemory;
|
Out.Location = MemoryArena + ClaimedMemory;
|
||||||
Out.Size = 1024 * 32;
|
Out.Size = 1024 * 200;
|
||||||
ClaimedMemory += Out.Size;
|
ClaimedMemory += Out.Size;
|
||||||
|
|
||||||
for(int FileIndex = 1; FileIndex < ArgC; ++FileIndex)
|
for(int FileIndex = 1; FileIndex < ArgC; ++FileIndex)
|
||||||
|
@ -116,7 +101,7 @@ main(int ArgC, char **Args)
|
||||||
if(HMML.well_formed)
|
if(HMML.well_formed)
|
||||||
{
|
{
|
||||||
Working.Location = MemoryArena + ClaimedMemory;
|
Working.Location = MemoryArena + ClaimedMemory;
|
||||||
Working.Size = 1024 * 2;
|
Working.Size = 1024 * 1;
|
||||||
ClaimedMemory += Working.Size;
|
ClaimedMemory += Working.Size;
|
||||||
|
|
||||||
sprintf(Working.Location,
|
sprintf(Working.Location,
|
||||||
|
@ -141,6 +126,7 @@ main(int ArgC, char **Args)
|
||||||
}
|
}
|
||||||
|
|
||||||
int AnnotationIndex = 0;
|
int AnnotationIndex = 0;
|
||||||
|
int ReferenceIndex = 1;
|
||||||
while(AnnotationIndex < HMML.annotation_count)
|
while(AnnotationIndex < HMML.annotation_count)
|
||||||
{
|
{
|
||||||
if(HMML.annotations[AnnotationIndex].reference_count)
|
if(HMML.annotations[AnnotationIndex].reference_count)
|
||||||
|
@ -161,26 +147,34 @@ main(int ArgC, char **Args)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < HMML.annotations[AnnotationIndex].reference_count; ++i)
|
for(int i = 0; i < HMML.annotations[AnnotationIndex].reference_count; ++i)
|
||||||
{
|
{
|
||||||
|
// NOTE(matt): Consider removing the ref_index class if it ain't needed
|
||||||
sprintf(Working.Location,
|
sprintf(Working.Location,
|
||||||
" <a data-id=\"%d\" href=\"%s\" target=\"_blank\" class=\"ref\">\n"
|
" <a data-id=\"%d\" href=\"%s\" target=\"_blank\" class=\"ref\">\n"
|
||||||
" <span data-timestamp=\"%d\" class=\"timecode\">(<span class=\"time\">%s</span>)</span>\n"
|
|
||||||
" <span class=\"ref_content\">\n"
|
" <span class=\"ref_content\">\n"
|
||||||
" <div class=\"source\">%s</div>\n"
|
" <div class=\"source\">%s</div>\n"
|
||||||
" <div class=\"ref_title\">%s</div>\n"
|
" <div class=\"ref_title\">%s</div>\n"
|
||||||
" </span>\n"
|
" </span>\n"
|
||||||
|
// NOTE(matt): Fill the div class="ref_indices" with <= 3 span
|
||||||
|
// class="ref_index" and ensure to put these <=3 spans on the same line without
|
||||||
|
// a space between them
|
||||||
|
" <div class=\"ref_indices\">\n"
|
||||||
|
" <span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[%d]</span><span class=\"time\">%s</span></span>\n"
|
||||||
|
" </div>\n"
|
||||||
" </a>\n",
|
" </a>\n",
|
||||||
AnnotationIndex,
|
AnnotationIndex,
|
||||||
HMML.annotations[AnnotationIndex].references[i].url,
|
HMML.annotations[AnnotationIndex].references[i].url,
|
||||||
TimecodeToSeconds(HMML.annotations[AnnotationIndex].time),
|
|
||||||
HMML.annotations[AnnotationIndex].time,
|
|
||||||
HMML.annotations[AnnotationIndex].references[i].site ? HMML.annotations[AnnotationIndex].references[i].site : HMML.annotations[AnnotationIndex].references[i].author,
|
HMML.annotations[AnnotationIndex].references[i].site ? HMML.annotations[AnnotationIndex].references[i].site : HMML.annotations[AnnotationIndex].references[i].author,
|
||||||
HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[AnnotationIndex].references[i].page : HMML.annotations[AnnotationIndex].references[i].title);
|
HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[AnnotationIndex].references[i].page : HMML.annotations[AnnotationIndex].references[i].title,
|
||||||
|
TimecodeToSeconds(HMML.annotations[AnnotationIndex].time),
|
||||||
|
ReferenceIndex,
|
||||||
|
HMML.annotations[AnnotationIndex].time);
|
||||||
|
|
||||||
Working.Ptr = Working.Location;
|
Working.Ptr = Working.Location;
|
||||||
while(*Working.Ptr)
|
while(*Working.Ptr)
|
||||||
{
|
{
|
||||||
*Out.Ptr++ = *Working.Ptr++;
|
*Out.Ptr++ = *Working.Ptr++;
|
||||||
}
|
}
|
||||||
|
++ReferenceIndex;
|
||||||
}
|
}
|
||||||
++AnnotationIndex;
|
++AnnotationIndex;
|
||||||
}
|
}
|
||||||
|
@ -204,22 +198,82 @@ HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[Annotati
|
||||||
*Out.Ptr++ = *Working.Ptr++;
|
*Out.Ptr++ = *Working.Ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DataRef = 0;
|
int DataRef = 1;
|
||||||
|
|
||||||
for(int AnnotationIndex = 0; AnnotationIndex < HMML.annotation_count; ++AnnotationIndex)
|
for(int AnnotationIndex = 0; AnnotationIndex < HMML.annotation_count; ++AnnotationIndex)
|
||||||
{
|
{
|
||||||
|
InPtr = HMML.annotations[AnnotationIndex].text;
|
||||||
|
|
||||||
|
Text.Location = MemoryArena + ClaimedMemory;
|
||||||
|
Text.Size = 256;
|
||||||
|
ClaimedMemory += Text.Size;
|
||||||
|
Text.Ptr = Text.Location;
|
||||||
|
|
||||||
if(HMML.annotations[AnnotationIndex].reference_count) // || HMML.annotations[AnnotationIndex].is_quote)
|
if(HMML.annotations[AnnotationIndex].reference_count) // || HMML.annotations[AnnotationIndex].is_quote)
|
||||||
{
|
{
|
||||||
sprintf(Working.Location,
|
sprintf(Working.Location,
|
||||||
" <div class=\"marker\" data-timestamp=\"%d\" data-ref=\"%d\">\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time), AnnotationIndex);
|
" <div class=\"marker\" data-timestamp=\"%d\" data-ref=\"%d\">\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time), AnnotationIndex);
|
||||||
|
|
||||||
|
for(int RefLocalIndex = 0; RefLocalIndex < HMML.annotations[AnnotationIndex].reference_count; ++RefLocalIndex)
|
||||||
|
{
|
||||||
|
while(InPtr - HMML.annotations[AnnotationIndex].text < HMML.annotations[AnnotationIndex].references[RefLocalIndex].offset)
|
||||||
|
{
|
||||||
|
*Text.Ptr++ = *InPtr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Inc = 0;
|
||||||
|
if(HMML.annotations[AnnotationIndex].references[RefLocalIndex].offset <= 2)
|
||||||
|
{
|
||||||
|
if(HMML.annotations[AnnotationIndex].references[RefLocalIndex].page)
|
||||||
|
{
|
||||||
|
Inc = sprintf(Text.Ptr, "%s",
|
||||||
|
HMML.annotations[AnnotationIndex].references[RefLocalIndex].page);
|
||||||
|
}
|
||||||
|
else if(HMML.annotations[AnnotationIndex].references[RefLocalIndex].site)
|
||||||
|
{
|
||||||
|
Inc = sprintf(Text.Ptr, "%s",
|
||||||
|
HMML.annotations[AnnotationIndex].references[RefLocalIndex].site);
|
||||||
|
}
|
||||||
|
else if(HMML.annotations[AnnotationIndex].references[RefLocalIndex].title)
|
||||||
|
{
|
||||||
|
Inc = sprintf(Text.Ptr, "%s",
|
||||||
|
HMML.annotations[AnnotationIndex].references[RefLocalIndex].title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: Potentially incomplete reference at %s:%d\n",
|
||||||
|
Args[0],
|
||||||
|
Args[FileIndex],
|
||||||
|
HMML.annotations[AnnotationIndex].line);
|
||||||
|
}
|
||||||
|
Text.Ptr += Inc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(HMML.annotations[AnnotationIndex].references[RefLocalIndex].offset <= 2 && Text.Ptr[-1] == ' ')
|
||||||
|
{
|
||||||
|
--Text.Ptr;
|
||||||
|
}
|
||||||
|
Inc = sprintf(Text.Ptr, "<sup>%d</sup>", DataRef);
|
||||||
|
Text.Ptr += Inc;
|
||||||
++DataRef;
|
++DataRef;
|
||||||
}
|
}
|
||||||
|
while(*InPtr)
|
||||||
|
{
|
||||||
|
*Text.Ptr++ = *InPtr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(Working.Location,
|
sprintf(Working.Location,
|
||||||
" <div class=\"marker\" data-timestamp=\"%d\">\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time));
|
" <div class=\"marker\" data-timestamp=\"%d\">\n", TimecodeToSeconds(HMML.annotations[AnnotationIndex].time));
|
||||||
|
while(*InPtr)
|
||||||
|
{
|
||||||
|
*Text.Ptr++ = *InPtr++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*Text.Ptr = '\0';
|
||||||
|
Text.Ptr = Text.Location;
|
||||||
Working.Ptr = Working.Location;
|
Working.Ptr = Working.Location;
|
||||||
while(*Working.Ptr)
|
while(*Working.Ptr)
|
||||||
{
|
{
|
||||||
|
@ -236,13 +290,15 @@ HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[Annotati
|
||||||
" </div>\n"
|
" </div>\n"
|
||||||
" </div>\n",
|
" </div>\n",
|
||||||
HMML.annotations[AnnotationIndex].time,
|
HMML.annotations[AnnotationIndex].time,
|
||||||
HMML.annotations[AnnotationIndex].text,
|
Text.Location,
|
||||||
HMML.annotations[AnnotationIndex].time,
|
HMML.annotations[AnnotationIndex].time,
|
||||||
HMML.annotations[AnnotationIndex].text,
|
Text.Location,
|
||||||
HMML.annotations[AnnotationIndex].time,
|
HMML.annotations[AnnotationIndex].time,
|
||||||
HMML.annotations[AnnotationIndex].text);
|
Text.Location);
|
||||||
Working.Ptr = Working.Location;
|
Working.Ptr = Working.Location;
|
||||||
|
|
||||||
|
ClaimedMemory -= Text.Size;
|
||||||
|
|
||||||
while(*Working.Ptr)
|
while(*Working.Ptr)
|
||||||
{
|
{
|
||||||
*Out.Ptr++ = *Working.Ptr++;
|
*Out.Ptr++ = *Working.Ptr++;
|
||||||
|
@ -279,6 +335,7 @@ HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[Annotati
|
||||||
" player.setTime(parseInt(time, 10));\n"
|
" player.setTime(parseInt(time, 10));\n"
|
||||||
" player.play();\n"
|
" player.play();\n"
|
||||||
" ev.preventDefault();\n"
|
" ev.preventDefault();\n"
|
||||||
|
" ev.stopPropagation();\n"
|
||||||
" return false;\n"
|
" return false;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" });\n"
|
" });\n"
|
||||||
|
@ -296,13 +353,14 @@ HMML.annotations[AnnotationIndex].references[i].page ? HMML.annotations[Annotati
|
||||||
"function onRefChanged(ref) {\n"
|
"function onRefChanged(ref) {\n"
|
||||||
" if (ref !== undefined && ref !== null) {\n"
|
" if (ref !== undefined && ref !== null) {\n"
|
||||||
" document.querySelector(\".refs_container\").classList.add(\"current\");\n"
|
" document.querySelector(\".refs_container\").classList.add(\"current\");\n"
|
||||||
" var refs = document.querySelectorAll(\".refs .ref\");\n"
|
" var refElements = document.querySelectorAll(\".refs .ref\");\n"
|
||||||
" for (var i = 0; i < refs.length; ++i) {\n"
|
" var refs = ref.split(\",\");\n"
|
||||||
" var dataID = refs[i].getAttribute(\"data-id\");\n"
|
"\n"
|
||||||
" if (ref == dataID) {\n"
|
" for (var i = 0; i < refElements.length; ++i) {\n"
|
||||||
" refs[i].classList.add(\"current\");\n"
|
" if (refs.includes(refElements[i].getAttribute(\"data-id\"))) {\n"
|
||||||
|
" refElements[i].classList.add(\"current\");\n"
|
||||||
" } else {\n"
|
" } else {\n"
|
||||||
" refs[i].classList.remove(\"current\");\n"
|
" refElements[i].classList.remove(\"current\");\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" } else {\n"
|
" } else {\n"
|
||||||
|
|
|
@ -14,46 +14,46 @@
|
||||||
<div class="mouse_catcher"></div>
|
<div class="mouse_catcher"></div>
|
||||||
<div class="refs">
|
<div class="refs">
|
||||||
<a data-id="3" href="https://github.com/ucb-bar/rocket/blob/master/src/main/scala/instructions.scala" target="_blank" class="ref">
|
<a data-id="3" href="https://github.com/ucb-bar/rocket/blob/master/src/main/scala/instructions.scala" target="_blank" class="ref">
|
||||||
<span data-timestamp="543" class="timecode">(<span class="time">9:03</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">GitHub</div>
|
<div class="source">GitHub</div>
|
||||||
<div class="ref_title">instructions.scala</div>
|
<div class="ref_title">instructions.scala</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="543" class="timecode"><span class="ref_index">[1]</span><span class="time">9:03</span></span>
|
||||||
</a>
|
</a>
|
||||||
<a data-id="3" href="https://en.wikipedia.org/wiki/Register-transfer_level" target="_blank" class="ref">
|
<a data-id="3" href="https://en.wikipedia.org/wiki/Register-transfer_level" target="_blank" class="ref">
|
||||||
<span data-timestamp="543" class="timecode">(<span class="time">9:03</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">Wikipedia</div>
|
<div class="source">Wikipedia</div>
|
||||||
<div class="ref_title">Register-transfer level</div>
|
<div class="ref_title">Register-transfer level</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="543" class="timecode"><span class="ref_index">[2]</span><span class="time">9:03</span></span>
|
||||||
</a>
|
</a>
|
||||||
<a data-id="4" href="https://forums.sifive.com/t/confusion-regarding-freedom-e-sdk-inline-asm/383" target="_blank" class="ref">
|
<a data-id="4" href="https://forums.sifive.com/t/confusion-regarding-freedom-e-sdk-inline-asm/383" target="_blank" class="ref">
|
||||||
<span data-timestamp="955" class="timecode">(<span class="time">15:55</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">SiFive Forums</div>
|
<div class="source">SiFive Forums</div>
|
||||||
<div class="ref_title">Confusion Regarding Freedom E SDK inline asm</div>
|
<div class="ref_title">Confusion Regarding Freedom E SDK inline asm</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="955" class="timecode"><span class="ref_index">[3]</span><span class="time">15:55</span></span>
|
||||||
</a>
|
</a>
|
||||||
<a data-id="6" href="https://riscv.org/specifications" target="_blank" class="ref">
|
<a data-id="6" href="https://riscv.org/specifications" target="_blank" class="ref">
|
||||||
<span data-timestamp="1344" class="timecode">(<span class="time">22:24</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">RISC-V"</div>
|
<div class="source">RISC-V"</div>
|
||||||
<div class="ref_title">User-Level ISA Specification v2.1</div>
|
<div class="ref_title">User-Level ISA Specification v2.1</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="1344" class="timecode"><span class="ref_index">[4]</span><span class="time">22:24</span></span>
|
||||||
</a>
|
</a>
|
||||||
<a data-id="8" href="http://ericw.ca/notes/a-tiny-guide-to-gcc-inline-assembly.html" target="_blank" class="ref">
|
<a data-id="8" href="http://ericw.ca/notes/a-tiny-guide-to-gcc-inline-assembly.html" target="_blank" class="ref">
|
||||||
<span data-timestamp="1733" class="timecode">(<span class="time">28:53</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">ericw.</div>
|
<div class="source">ericw.</div>
|
||||||
<div class="ref_title">A Tiny Guide to GCC Inline Assembly</div>
|
<div class="ref_title">A Tiny Guide to GCC Inline Assembly</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="1733" class="timecode"><span class="ref_index">[5]</span><span class="time">28:53</span></span>
|
||||||
</a>
|
</a>
|
||||||
<a data-id="10" href="https://riscv.org/specifications/privileged-isa/" target="_blank" class="ref">
|
<a data-id="10" href="https://riscv.org/specifications/privileged-isa/" target="_blank" class="ref">
|
||||||
<span data-timestamp="2421" class="timecode">(<span class="time">40:21</span>)</span>
|
|
||||||
<span class="ref_content">
|
<span class="ref_content">
|
||||||
<div class="source">RISC-V</div>
|
<div class="source">RISC-V</div>
|
||||||
<div class="ref_title">Draft Privileged ISA Specification v1.9.1</div>
|
<div class="ref_title">Draft Privileged ISA Specification v1.9.1</div>
|
||||||
</span>
|
</span>
|
||||||
|
<span data-timestamp="2421" class="timecode"><span class="ref_index">[6]</span><span class="time">40:21</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -90,21 +90,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="543" data-ref="3">
|
<div class="marker" data-timestamp="543" data-ref="3">
|
||||||
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala and research register-transfer level</div>
|
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala<sup>1</sup> and research register-transfer level<sup>2</sup></div>
|
||||||
<div class="progress faded">
|
<div class="progress faded">
|
||||||
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala and research register-transfer level</div>
|
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala<sup>1</sup> and research register-transfer level<sup>2</sup></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress main">
|
<div class="progress main">
|
||||||
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala and research register-transfer level</div>
|
<div class="content"><span class="timecode">9:03</span>Revisit instructions.scala<sup>1</sup> and research register-transfer level<sup>2</sup></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="955" data-ref="4">
|
<div class="marker" data-timestamp="955" data-ref="4">
|
||||||
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread</div>
|
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread<sup>3</sup></div>
|
||||||
<div class="progress faded">
|
<div class="progress faded">
|
||||||
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread</div>
|
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread<sup>3</sup></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress main">
|
<div class="progress main">
|
||||||
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread</div>
|
<div class="content"><span class="timecode">15:55</span>Come to understand how to specify that rs1 represents an immediate or a register, thanks to the reply to the "Confusion Regarding Freedom E SDK inline asm" forum thread<sup>3</sup></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="1105">
|
<div class="marker" data-timestamp="1105">
|
||||||
|
@ -117,12 +117,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="1344" data-ref="6">
|
<div class="marker" data-timestamp="1344" data-ref="6">
|
||||||
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification</div>
|
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification<sup>4</sup></div>
|
||||||
<div class="progress faded">
|
<div class="progress faded">
|
||||||
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification</div>
|
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification<sup>4</sup></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress main">
|
<div class="progress main">
|
||||||
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification</div>
|
<div class="content"><span class="timecode">22:24</span>Read about CSRRCI in the CSR Instructions section of the User-Level ISA Specification<sup>4</sup></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="1385">
|
<div class="marker" data-timestamp="1385">
|
||||||
|
@ -135,12 +135,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="1733" data-ref="8">
|
<div class="marker" data-timestamp="1733" data-ref="8">
|
||||||
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax</div>
|
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax<sup>5</sup></div>
|
||||||
<div class="progress faded">
|
<div class="progress faded">
|
||||||
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax</div>
|
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax<sup>5</sup></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress main">
|
<div class="progress main">
|
||||||
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax</div>
|
<div class="content"><span class="timecode">28:53</span>GNU Assembly Syntax: Constraints and Syntax<sup>5</sup></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="2115">
|
<div class="marker" data-timestamp="2115">
|
||||||
|
@ -153,12 +153,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="2421" data-ref="10">
|
<div class="marker" data-timestamp="2421" data-ref="10">
|
||||||
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses</div>
|
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses<sup>6</sup></div>
|
||||||
<div class="progress faded">
|
<div class="progress faded">
|
||||||
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses</div>
|
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses<sup>6</sup></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress main">
|
<div class="progress main">
|
||||||
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses</div>
|
<div class="content"><span class="timecode">40:21</span>Pop back up to the top of the stack, to reset_demo(), and read about the currently allocated RISC-V machine-level CSR addresses<sup>6</sup></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="marker" data-timestamp="2651">
|
<div class="marker" data-timestamp="2651">
|
||||||
|
@ -244,6 +244,7 @@ for (var i = 0; i < refTimecodes.length; ++i) {
|
||||||
player.setTime(parseInt(time, 10));
|
player.setTime(parseInt(time, 10));
|
||||||
player.play();
|
player.play();
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -261,13 +262,14 @@ for (var i = 0; i < refSources.length; ++i) {
|
||||||
function onRefChanged(ref) {
|
function onRefChanged(ref) {
|
||||||
if (ref !== undefined && ref !== null) {
|
if (ref !== undefined && ref !== null) {
|
||||||
document.querySelector(".refs_container").classList.add("current");
|
document.querySelector(".refs_container").classList.add("current");
|
||||||
var refs = document.querySelectorAll(".refs .ref");
|
var refElements = document.querySelectorAll(".refs .ref");
|
||||||
for (var i = 0; i < refs.length; ++i) {
|
var refs = ref.split(",");
|
||||||
var dataID = refs[i].getAttribute("data-id");
|
|
||||||
if (ref == dataID) {
|
for (var i = 0; i < refElements.length; ++i) {
|
||||||
refs[i].classList.add("current");
|
if (refs.includes(refElements[i].getAttribute("data-id"))) {
|
||||||
|
refElements[i].classList.add("current");
|
||||||
} else {
|
} else {
|
||||||
refs[i].classList.remove("current");
|
refElements[i].classList.remove("current");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,6 +66,7 @@ Player.prototype.play = function() {
|
||||||
if (!this.playing) {
|
if (!this.playing) {
|
||||||
this.youtubePlayer.playVideo();
|
this.youtubePlayer.playVideo();
|
||||||
}
|
}
|
||||||
|
this.pauseAfterBuffer = false;
|
||||||
} else {
|
} else {
|
||||||
this.shouldPlay = true;
|
this.shouldPlay = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ body {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-bottom: 1px solid rgb(51, 51, 51);
|
border-bottom: 1px solid rgb(51, 51, 51);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
|
@ -185,18 +185,43 @@ body {
|
||||||
|
|
||||||
.refs .ref .timecode {
|
.refs .ref .timecode {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 55px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding-right: 10px;
|
padding: 0;
|
||||||
text-align: right;
|
}
|
||||||
|
|
||||||
|
.refs .ref .ref_indices {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refs .ref .ref_indices .timecode {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refs .ref .ref_indices .timecode:first-child::before {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
.refs .ref .ref_indices .timecode::before {
|
||||||
|
content: "•";
|
||||||
|
margin: 0 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refs .ref .timecode:hover .time {
|
.refs .ref .timecode:hover .time {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.refs .ref .ref_content {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.refs .ref .source {
|
.refs .ref .source {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: #888;
|
color: #888;
|
||||||
line-height: 8px;
|
line-height: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.refs .ref .timecode .ref_index {
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue