2857ac72a5
Sort of functional implementation
2016-05-01 20:34:11 -04:00
a44e5fda1f
Add helpful printing functions for testing
2016-05-01 20:32:57 -04:00
Jacob
01b26c686f
Merge branch 'master' of adamgoldsmith.name:WPI/CS2011/cachelab
...
Merging Adam's changes to trans.c with my changes to csim.c.
2016-04-29 18:02:01 -04:00
Jacob
8e948abbc3
Slightly reorganized cache_access. Moved set re-linking to new function update_set.
...
Amend: Missed one instance of changed variable name.
2016-04-29 17:59:13 -04:00
Jacob
ec29b81418
Slightly reorganized cache_access. Moved set re-linking to new function update_set.
2016-04-29 17:57:02 -04:00
Jacob
93801e248b
Multiple mostly-stylistic changes, and improved argument checking.
...
parse_int_arg no checks that -E is given nothing larger than a long.
Simplified conditions in increment_result_counters.
Added braces to conditional blocks without any.
Added conditions to stop if calloc returns NULL.
2016-04-29 17:46:48 -04:00
Jacob
df84d11ffb
Modified parse_int_arg to better handle too-large and too-small associativities.
2016-04-29 17:17:52 -04:00
Jacob
f018d83848
Renamed block_bits to block_offset_bits. Fixed minor type errors.
...
Fixed format specifiers in bits_to_size(), fixed casts for set_index_bits and block_offset_bits during argument parsing.
2016-04-29 10:48:55 -04:00
Jacob
80c595ada2
Updated and add doc comments. Also added various todos for next commit.
2016-04-29 10:44:40 -04:00
bd06a5c208
Make verbose printing closer to reference simulator
2016-04-28 20:53:59 -04:00
Jacob
189807e834
Reordered functions.
...
Moved functions into labelled sections.
Made function definition order consistent with prototype order.
Todo: Add section descriptions, break out additional functions, add doc comments.
2016-04-28 12:03:18 -04:00
Jacob
927b7bd6a7
Renamed set_indices to num_sets. Commented out extraneous VERBOSE print_cache call.
2016-04-28 01:46:49 -04:00
ca9f6ddc77
Improve verbose printing
2016-04-28 01:55:38 -04:00
e457f4dee0
Fix cache_access
2016-04-28 01:55:38 -04:00
9997f58137
Mostly functional cache_access
2016-04-28 01:55:38 -04:00
27b90ae3ed
Add missing function prototypes
2016-04-28 01:55:38 -04:00
8548d6ede5
Move print_cache into main loop
2016-04-28 01:55:38 -04:00
60fc5d1f0a
Use struct for score, add function to increment from char
2016-04-28 01:55:38 -04:00
a31fde98e4
Add find_line
2016-04-28 01:55:38 -04:00
Jacob
88240dab06
Added make test, which uses -Wextra, and doesn't use -Werror.
2016-04-27 22:29:16 -04:00
29e74799e3
Actually use hits, misses and evictions in printSummary
2016-04-27 22:26:04 -04:00
92ae2a0a2b
Add function to print cache
2016-04-27 22:16:16 -04:00
c26d27db9d
Fix number of sets/lines created
2016-04-27 22:16:01 -04:00
Jacob
b556be1622
Implemented linked_lines and modified cache creation/deletion.
...
Replaced struct line_s and typedef line with linked_line_s and linked_line.
Added make_set() and free_set().
Modified make_cache() and free_cache() to call make_set() and free_set().
2016-04-27 21:24:53 -04:00
Jacob
7f254fd50b
Fixed types.
...
size_t -> long
uint8_t -> uint8_t or int
2016-04-27 18:18:30 -04:00
acb6900502
Properly close file
2016-04-27 16:15:02 -04:00
2fc771d08e
Add cache allocation and free functions
2016-04-27 16:13:27 -04:00
Jacob
d16bf870f6
Ignoring test files, emacs drafts, and emacs buffers.
2016-04-27 16:00:51 -04:00
Jacob
fb6c9e3a27
Various minor changes.
...
Renamed lines to num_lines.
Removed trailing whitespaces.
Fixed some indentation and comments.
Fixed usage string.
2016-04-27 15:55:27 -04:00
Jacob
50ee8769fa
See previous commit.
...
I did that slightly wrong, not quite sure how. But this one is the most-changed, and all the notes are in the last commit.
2016-04-27 13:41:51 -04:00
Jacob
3b97949150
Implemented size calculation. Various minor changes.
...
Replaced repeated "printf(...);exit(1)" with bad_usage_error().
Added bits_to_size().
Reorganized code above main().
Added file doc comment.
Expanded argument-printing statement for better testing.
2016-04-27 13:40:58 -04:00
4f09ea0249
Add basic file parsing
2016-04-27 12:12:11 -04:00
Jacob
8d8568fce1
Fixed compilation issues.
...
- Removed unused variable argflags.
- Fixed variable name (index_bits -> set_index_bits).
2016-04-27 12:07:51 -04:00
Jacob
0fc77a6828
Moved print_usage and parse_int_arg below main.
2016-04-27 12:03:51 -04:00
Jacob
490d8cafde
Restored old method of checking for presence of arguments.
2016-04-27 12:00:34 -04:00
Jacob
dc67c24899
New and improved argument parsing with getopt.
...
Added checking that all arguments were provided.
Switched many variables to use size_t, and int8_t where appropriate.
Moved opening braces on to previous lines, except function braces.
Renamed set_bits to more-accurate index_bits.
2016-04-27 12:00:34 -04:00
0a660b8939
Convert spaces to tabs
2016-04-26 10:44:50 -04:00
03d08c71af
Move verbose to global VERBOSE
2016-04-26 10:31:37 -04:00
0b947b701f
Improve int argument parsing
2016-04-26 10:22:34 -04:00
70b79a8b56
Add .gitignore
2016-04-26 10:22:15 -04:00
Jacob
0a3f87840d
Added usage string.
2016-04-26 10:03:04 -04:00
210eeb05dd
Correct python version in driver.py
2016-04-25 23:59:12 -04:00
2a8124df09
Added basic argument parsing
2016-04-25 17:07:24 -04:00
568fa2a6f8
More trailing whitespace
2016-04-24 20:32:36 -04:00
483fa8458d
delete trailing newlines
2016-04-24 20:12:20 -04:00
b4e31f122a
Initial Commit
2016-04-24 20:07:46 -04:00