-
Notifications
You must be signed in to change notification settings - Fork 81
Basic virtual memory implementation #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ef495a6
dd735fd
b29b13f
8c23cd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please delete the accidentally committed files. |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,10 +69,12 @@ void SimpleAsm::clear() { | |
|
||
void SimpleAsm::setup( | ||
machine::FrontendMemory *mem, | ||
machine::MachineConfig config, | ||
SymbolTableDb *symtab, | ||
machine::Address address, | ||
machine::Xlen xlen) { | ||
this->mem = mem; | ||
this->config = config; | ||
this->symtab = symtab; | ||
this->address = address; | ||
this->symtab->setSymbol("XLEN", static_cast<uint64_t>(xlen), sizeof(uint64_t)); | ||
|
@@ -286,7 +288,12 @@ bool SimpleAsm::process_line( | |
if (error_ptr != nullptr) { *error_ptr = error; } | ||
return false; | ||
} | ||
address = machine::Address(value); | ||
qint64 offset = qint64(value); | ||
qint64 base = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: please prefer standard cpp types over qt ones whenever possible. |
||
if (config.get_vm_enabled() && config.get_vm_mode() == machine::MachineConfig::VM_SV32) { | ||
base = config.get_va_base_addr(); | ||
} | ||
address = machine::Address(base + offset); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now looking at this, wouldn't it be simpler to just pass the base to the assembler constructor and keep this logic outside? |
||
return true; | ||
} | ||
if ((op == ".space") || (op == ".skip")) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ class SimpleAsm : public QObject { | |
void clear(); | ||
void setup( | ||
machine::FrontendMemory *mem, | ||
machine::MachineConfig config, | ||
SymbolTableDb *symtab, | ||
machine::Address address, | ||
machine::Xlen xlen); | ||
|
@@ -79,6 +80,7 @@ class SimpleAsm : public QObject { | |
private: | ||
QStringList include_stack; | ||
machine::FrontendMemory *mem {}; | ||
machine::MachineConfig config {}; | ||
machine::RelocExpressionList reloc; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be a pointer - it feels weirt to have multiple copies of machine config in the program. |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,9 @@ add_executable(gui | |
${gui_SOURCES} | ||
${gui_HEADERS} | ||
${gui_UI} | ||
${gui_RESOURCES}) | ||
${gui_RESOURCES} | ||
dialogs/new/bigslider.h | ||
dialogs/new/bigslider.cpp) | ||
target_include_directories(gui PUBLIC . windows/coreview) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please move this to the lists above. |
||
target_link_libraries(gui | ||
PRIVATE ${QtLib}::Core ${QtLib}::Widgets ${QtLib}::Gui | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I do this on my machine is that I configure the files to be
build/Debug
andbuild/Release
. You can also ignore thise files localy. It should not be here.