Skip to content
Snippets Groups Projects
Commit ec16e704 authored by jz8u17's avatar jz8u17
Browse files

Reorganized

parent f6869733
No related branches found
No related tags found
No related merge requests found
/run_parallel/
/finegrain/run_parallel/
/finegrain/*.txt
/finegrain/bin/
/results/
/model/bin/
!/hibernus_validation/
*.exe
*.out
*.o
*.ilk
*.pdb
*.csv
......
# Explanation of each c file
# Exploring the Effect of Energy Storage Sizing on Intermittent Computing System Performance
## Current folder:
This repository contains the software used for exploring energy storage sizing effect on *intermittent computing* systems.
1. msp_hiber.c: capacitor sizing test based on MSP430 MCU
and Hibernus transient approach.
Three sets of software are provided here:
- A *theoretical* model used for approximating forward progress of intermittent computing systems with constant supply current.
- A *finegrain* model used for simulating forward progress of intermittent computing systems with energy harvesting conditions (dynamic supply current).
- Embedded software (adapted [Hibernus](https://ieeexplore.ieee.org/abstract/document/6960060?casa_token=MKSfvesOIMsAAAAA:srUgSqoEAtmTTJ65Re7vh3uyq9a7D6DXrOLPzgNndRZFQ9hSgMUiPTCB2gzIij1olI7lhvU)) used for experimental validation.
2. size_harv_stor.c: scaling energy harvester (pv cell area)
and energy storage capacity (capacitor capacitance)
together, using equation to speed up forward progress
estimation.
Results can be found in the paper published (*---link to be provided---*) and the corresponding [dataset](https://eprints.soton.ac.uk/447811/).
3. size_harvester.c: similar to 7, but scale energy
harvester only.
## File structure
| Folder | Description |
| ------------------- | ----------- |
| data | Irradiance data for simulation, imported from <br> [NREL Solar Radiation Research Laboratory](https://midcdmz.nrel.gov/apps/sitehome.pl?site=BMS) (outdoor solar) <br> and [EnHANTs](https://enhants.ee.columbia.edu/indoor-irradiance-meas) dataset (indoor light) |
| finegrain | The finegrain model |
| hibernus_validation | A [TI Code Composer Studio](https://www.ti.com/tool/CCSTUDIO) (CCS) project folder of <br> an adapted version of *Hibernus* for validating results |
| model | The theoretical model |
4. size_storage.c: similar to 7, but scale energy storage
only.
5. sizemodel.c: time-based simulation model with adaptive
time step.
## 'tests' folder:
6. countline.c: line counter test program for counting
the number of data lines in order to obtain the data time
length.
7. pv_model.c: PV cell model test program.
8. test.c: test program that actually you can write anything.
<!-- oldPN folder
9. cap_test_mcu.c: Power-neutral (PN) performance test
base on MCU power & clock frequency settings.
10. cap_test_odroid.c: Power-neutral (PN) performance test
base on ODROID power & clock frequency settings.
11. capacitor_test.c: Similar to 1 and 2, but output different
messages from 1 and 2, please see their 'printf' part. -->
## Usage
- The CCS project is developed upon MSP430FR6989, can be directly imported to CCS.
- For usage of the two models, please see README in each subfolder.
\ No newline at end of file
// #ifdef _WIN64
// #define _CRT_SECURE_NO_WARNINGS
// #pragma warning(disable : 4996)
// #pragma warning(disable : 4995)
// #endif
// no use...
CC = gcc
CFLAGS = -Wall -std=c11
OUT_DIR = bin/
.PHONY : all clean output_directory
all : output_directory \
$(OUT_DIR)stor_constcurrent \
$(OUT_DIR)harv_stor \
$(OUT_DIR)show_period \
$(OUT_DIR)rs_to_ram \
$(OUT_DIR)harv_stor_tradeoff \
$(OUT_DIR)harv_stor_range \
$(OUT_DIR)harv_stor_division \
$(OUT_DIR)harv_stor_compare \
$(OUT_DIR)costfunction
output_directory :
@mkdir -p $(OUT_DIR)
clean :
rm -rf *.o bin/
model.o : model.c model.h
$(CC) -c $< $(CFLAGS) -o $@
$(OUT_DIR)stor_constcurrent : stor_constcurrent.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)harv_stor : harv_stor.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)show_period : show_period.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)rs_to_ram : rs_to_ram.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)harv_stor_tradeoff : harv_stor_tradeoff.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)harv_stor_range : harv_stor_range.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)harv_stor_division : harv_stor_division.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)harv_stor_compare : harv_stor_compare.c model.o
$(CC) $^ $(CFLAGS) -o $@
$(OUT_DIR)costfunction : costfunction.c model.o
$(CC) $^ $(CFLAGS) -o $@
\ No newline at end of file
<!-- # Explanation of each c file
## Current folder:
1. msp_hiber.c: capacitor sizing test based on MSP430 MCU
and Hibernus transient approach.
2. size_harv_stor.c: scaling energy harvester (pv cell area)
and energy storage capacity (capacitor capacitance)
together, using equation to speed up forward progress
estimation.
3. size_harvester.c: similar to 7, but scale energy
harvester only.
4. size_storage.c: similar to 7, but scale energy storage
only.
5. sizemodel.c: time-based simulation model with adaptive
time step.
## 'tests' folder:
6. countline.c: line counter test program for counting
the number of data lines in order to obtain the data time
length.
7. pv_model.c: PV cell model test program.
8. test.c: test program that actually you can write anything. -->
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -62,9 +62,9 @@ int main(int argv, char** argc)
// read test ranges of capacitance and current
printf("Please enter c_min c_step c_no (int int int, 'uF'): \n");
scanf_s("%d %d %d", &c_min, &c_step, &c_no);
scanf("%d %d %d", &c_min, &c_step, &c_no);
printf("Please enter i_min i_step i_no (double double int, 'mA'): \n");
scanf_s("%lf %lf %d", &i_min, &i_step, &i_no);
scanf("%lf %lf %d", &i_min, &i_step, &i_no);
// allocate memory for storing resutls
// table for data with integral capacitance
......@@ -88,7 +88,7 @@ int main(int argv, char** argc)
// csv file to store those maximum / optimal values
FILE* fp1 = NULL;
if (fopen_s(&fp1, "results\\stor_constcurrent_maxfwps.csv", "w") != 0) {
if ((fp1 = fopen("results\\stor_constcurrent_maxfwps.csv", "w")) == NULL) {
printf("Failed to write file stor_constcurrent_maxfwps.csv.\n");
return 1;
}
......@@ -172,7 +172,7 @@ int print_csv(double **table, double **table_small_cap, int row, int col, int no
{
// store
FILE* fp2 = NULL;
if (fopen_s(&fp2, "results\\stor_constcurrent.csv", "w") != 0) {
if ((fp2 = fopen("results\\stor_constcurrent.csv", "w")) == NULL) {
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment